How can I get the ID of an element using jQuery?

后端 未结 19 2829
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 11:57

Why doesn\'

19条回答
  •  庸人自扰
    2020-11-22 12:23

    .id is not a valid jquery function. You need to use the .attr() function to access attributes an element possesses. You can use .attr() to both change an attribute value by specifying two parameters, or get the value by specifying one.

    http://api.jquery.com/attr/

提交回复
热议问题