jQuery selector for inputs with square brackets in the name attribute

后端 未结 5 1279
醉梦人生
醉梦人生 2020-11-22 06:18

I\'m trying to select this element which has square brackets in the name attribute:


         


        
5条回答
  •  借酒劲吻你
    2020-11-22 07:04

    Just separate it with different quotes:

    
    

    JQuery:

    var value = $('input[name="myName[1][data]"]').val();
    

提交回复
热议问题