jquery selector not working with [ ]

前端 未结 3 1596
南笙
南笙 2021-01-27 11:52

I\'m using jQuery to manipulate form data in an osCommerce instance and I\'m having trouble selecting some elements.

The script generates textareas with the id product_d

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-27 12:11

    $("#product_description\\[1\\]").attr("id", "products_description_1");
    

    is the right code, look at "ID-Selector" on jQuery.com

提交回复
热议问题