In this tutorial, you will see the use of autofoucs and disabled attribute.
In this tutorial, you will see the use of autofoucs and disabled attribute.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 of type attribute of button tag in HTML5.
<button attribute >Text area </button> |
<!doctype html> <html > <head> <title> Insert title of document. </title> </head> <body> <p><b>Example of disabled and autofocus attribute of button tag in HTML5.</b></p> <form> <table style="width: 50%"> <caption style="text-decoration:none">Student Information</caption> <tr> <td>Stud_Id</td> <td> </td> <td><input name="Text1" type="text"></td> </tr> <tr> <td>Stud_Name</td> <td> </td> <td><input name="Text4" type="text"></td> <caption><input name="Text3" type="text"></caption> </tr> <tr> <td>Stud_Address</td> <td> </td> <td><input name="Text2" type="text"></td> </tr> <tr> <td>Stud_Age</td> <td> </td> <td><input name="Text5" type="text" style="width: 124px"></td> </tr> <tr> <td><button type="submit" disabled="disabled" > Reset</button></td> <td><button type="button" autofoucs>Button</button></td> <td><button type="submit" >Submit</button></td> </tr> </table></form> </body></html> |
autofocus attribute not present in HTML4.01. But disabled attribute present in both.