jQuery Attribute selector with a period

前端 未结 4 948
一向
一向 2020-12-04 02:42

I\'m trying to use a jQuery selector that finds all input fields with a specific name:

$(\'input[name=Filter\']).click(function() {
    // do something
});
<         


        
4条回答
  •  青春惊慌失措
    2020-12-04 03:27

    This works, you just need "" around the name:

    $('input[name="Parent.Filter"]').click(function() {
    });
    

提交回复
热议问题