<div class="form_container">
<form id="myform" onsubmit="return handle_form_submission()">
<input type="text" name='name' id='name' placeholder='Name'/>
<button type='submit'>Post it</button>
</form>
</div>
.form_container
{
width:450px;
height:100px;
display:inline-block;
margin:20px 20px;
padding:10px;
}
.form_container input[type='text'],
.form_container button
{
padding:8px;
font-size:1.5em;
}
function handle_form_submission()
{
alert('Submit button pressed');
return false; //do not submit the form
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.