How to give a div tag focus when its contents are clicked using JQuery or CSS
Is there a way to give a div tag focus when you cli开发者_运维知识库ck on its contents? Using CSS or JQuery?
The HTML5 draft extends the tabindex attribute so that setting it to 0 or a negative number will make an element focus-able if it isn't usually so.
The usual provisos about new features in drafts having limited browser support and limited support by assistive technologies (such as screen readers) apply.
In general, if you need to be able to give the focus to a control, it is better to pick an element that is designed to accept the focus in the first place.
精彩评论