How can I get name of element with jQuery?

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

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

相关标签:
7条回答
  • 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

    0 讨论(0)
提交回复
热议问题