jQuery Dynamically focus on the first INPUT or Textarea

后端 未结 9 1399
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 04:11

Here\'s a tricky one to start the morning.

I have a series of icons. When you click an icon it loads a form. Some of the forms have input[text] others have textareas

9条回答
  •  离开以前
    2020-12-29 04:29

    $(":input:first").focus(); 
    

    The :input selector grabs all input, textarea, select and button elements.

提交回复
热议问题