Your host:
Stephen Chapman
Stephen Chapman

Buttons

The button element works almost identically to the input element when you specify a type of button, reset, or submit. As with an input tag, the button tag must be placed within a form (anyone using it outside of a form even when they have it in a web page where the code validates is using it incorrectly).

Here is the minimum amount of code that you'd need in order to use a button tag correctly (since if you didn't provide some HTML to style the button text you might as well use an input tag instead).

<form action="index.html" method="get">
<div>
<button type="submit"><em>Home</em></button>
</div>
</form>

The only difference in usage between using an input tag and a button tag to create a button are that the input tag is self closing and has the button text supplied via a value attribute while a button tag does not have a value attribute and instead supplies the button text between the opening and closing button tags. This means that you can include HTML inside of the text of your button allowing you to provide something more than just plain text in your button.

Copyright © Felgall Pty Ltd
Web Hosting | VPS Hosting | Dedicated Hosting
Renegade Motorhomes - Credit Card Consolidation - Debt Consolidation - Nevis Hotel