jQuery match multiple attributes

前端 未结 2 998
夕颜
夕颜 2020-12-13 17:31

I have the following markup, and I want to make the All radio button checked.

2条回答
  •  春和景丽
    2020-12-13 18:07

    I was beating my head against a wall similar to this and just want to point out that in jQuery 1.3 the syntax used in the accepted answer is the ONLY syntax that will work. The questioner uses the @ syntax for the expression which does not work at all in jQuery. Hopefully this helps the next guy to come across this question via Google =p

    To be clear, you have to use

    jQuery('input[name=field1][val=checked]') 
    

    and not

    jQuery('input[@name=field1][@val=checked]')
    

提交回复
热议问题