1

Maybe the following question is stupid:-), it will bring me negateive votes.

I want to set focus for element specified in a web page. But I found that it seems that not all element in the page can be set successly(It make sense compare with desktop application's element).

so, What kind of element in a web page can be set focus?

JYP2011
  • 23
  • 5
  • 1
    Does this answer your question? [Which HTML elements can receive focus?](https://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus) – nurge Jun 30 '20 at 09:09

2 Answers2

0

Maybe this helps

The HTMLElement.focus() method sets focus on the specified element, if it can be focused. The focused element is the element which will receive keyboard and similar events by default.

So as they it is the elements can receive keyboard or such input events by default.

Source MDN

0

There's no official list of focus()able HTMLElements.

There's allyjs which shows which elements individual browsers consider focusable or tabbable (keyboard focusable).

I wouldn't say the question is stupid at all.

Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72