jQuery id selector works only for the first element

后端 未结 7 2088
借酒劲吻你
借酒劲吻你 2020-11-22 02:55

I have 3 buttons with same id, I need to get each button value when he\'s being clicked.

7条回答
  •  故里飘歌
    2020-11-22 03:14

    From my experience, if you use $('button#xyz') selector instead it will work. That's a hack, but it's still invalid HTML.

提交回复
热议问题