How to place the cursor (auto focus) in text box when a page gets loaded without javascript support?

后端 未结 6 465
野趣味
野趣味 2020-12-04 17:26

I have a form with some text fields,and I want to place the cursor (auto focus) on first text field of form when page gets loaded.

I want to do it without usi

6条回答
  •  盖世英雄少女心
    2020-12-04 17:58

    Ya its possible to do without support of javascript..
    We can use html5 auto focus attribute
    For Example:

    
    

    If use it (autofocus="autofocus") in text field means that text field get focused when page gets loaded.. For more details:
    http://www.hscripts.com/tutorials/html5/autofocus-attribute.html

提交回复
热议问题