how to make a DIV unfocusable?

前端 未结 5 1609
情深已故
情深已故 2021-02-07 10:16

I met a problem about HTML rendering.

In dir=\"rtl\" document of IE7, when JavaScript tries to set focus to a DIV element(with oElement.focus() method), the rendering tu

5条回答
  •  终归单人心
    2021-02-07 10:50

    Additionally, If you want to make a focussable element(form input elements etc.) as unfocussable. You can set :

    tabIndex = "-1"
    
    document.getElementById("yourElement").setAttribute("tabIndex", "-1");
    

提交回复
热议问题