Why not use Javascript handlers on the body element?

后端 未结 8 1470
有刺的猬
有刺的猬 2020-12-11 05:50

As an answer to the question of \'How do you automatically set the focus to a textbox when a web page loads?\', Espo suggests using



        
8条回答
  •  甜味超标
    2020-12-11 06:32

    Well, '' is an invalid id value if you ask me. I wouldn't use any characters like this.

    And for good practice, it's better to use window.onload IMO and place it in the tag. OR Better yet, you can move it to a .js file and cache it for speed.

提交回复
热议问题