How can I get name of element with jQuery?

前端 未结 7 1029
执笔经年
执笔经年 2021-01-30 07:49

How can I get name property of HTML element with jQuery?

7条回答
  •  Happy的楠姐
    2021-01-30 08:34

    You should use attr('name') like this

     $('#yourid').attr('name')
    

    you should use an id selector, if you use a class selector you encounter problems because a collection is returned

提交回复
热议问题