jQuery - Selector for duplicate ID's

前端 未结 7 1198
名媛妹妹
名媛妹妹 2020-12-02 00:40

I have a page with duplicate ID\'s for a form element. The catch is I the elements show up separately based on a toggle. So both ID\'s never show up simultaneously.

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 01:06

    As the myriad of other questions about this premise will tell you, you cannot use the ID selector # in this case; you have to use something like $('div[id=foo]') to find it.

提交回复
热议问题