Focusing a DIV in JavaScript

It is possible to focus a DIV or another HTML elements with JavaScript by using the tabindex tag, this tag allows us to stablish whether an element can be focused or not, with “-1” value elements can’t be tabbed but it can be focused, with “0” value the element can be focused via the keyboard and tabbed following the normal flow of the document. Values greater than 0 set the priority level for this tab flow, 1 is the most important value.




Code in Fiddle:

Tagged with: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.