Share on Google+Share on Google+

Button disabled in HTML5, Example of autofoucs and disabled attribute.

In this tutorial, you will see the use of autofoucs and disabled attribute.

Button disabled in HTML5.


In this section, you will see the use of disabled and autofocus attribute of button tag. If disabled attribute presents in button controls. It can not receive user instruction. If autofocus attribute is available in button tag. It specifies that controls will be focus automatically, when page load.

Attributes of type tag:
Attribute Value Description
disabled disabled or empty it does not receive user instruction.
autofocus autofocus automatically focus when page loads.

Declaration Syntax :

Declaration syntax of type attribute of button  tag in HTML5.

                         <button  attribute >Text area </button>

Example of <button > in HTML5:

<!doctype html>
<html >
<title> Insert title of document. </title>
<p><b>Example of disabled and autofocus attribute of&nbsp; button tag in HTML5.</b></p>
<table style="width: 50%">
<caption style="text-decoration:none">Student Information</caption>
<td><input name="Text1" type="text"></td>
<td><input name="Text4" type="text"></td>
<caption><input name="Text3" type="text"></caption>
<td><input name="Text2" type="text"></td>
<td><input name="Text5" type="text" style="width: 124px"></td>
<td><button type="submit" disabled="disabled" > Reset</button></td>
<td><button type="button" autofoucs>Button</button></td>
<td><button type="submit" >Submit</button></td>

Download this code

Difference Between HTML5 and HTML4.01:

autofocus attribute not present in HTML4.01. But disabled attribute present in both.



Posted on: September 16, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null