Detect HTML5 attribute:How to implement and use autofous attribute in IE7 and IE8.
January 1, 2011 Leave a comment
As we know the new HTML5 autofocus attribute helps the browser to give focus to the form element. It helps to jump to the autofocused input box while our page loads.While I was checking that <input> autofocus attribute in my browser (I am using IE8) I found that IE8 is not detecting that attribute.But, I have got a solution, a tricky and way, to use and implement autofocus attribute in IE8. Just copy the given code and save it as .html file and check it.
// Focus auto-focus fields
First name:<input type=”text” name=”fname” /><br />
Last name: <input type=”text” name=”lname” /><br />
<input type=”submit” />