开发者

class of a DOM and jQUery

开发者 https://www.devze.com 2023-02-28 14:44 出处:网络
I sometimes se开发者_如何转开发e that there is something like this: <input name=\"star2\" type=\"radio\" class=\"star 1\"/>

I sometimes se开发者_如何转开发e that there is something like this:

<input name="star2" type="radio" class="star 1"/>


<input name="star2" type="radio" class="star 2"/>

is it possible in jQuery to let one class to handle these two class? Because basically they have the same parent class, which is star? If it is possible, how can I do that? Using regular expression?


Yes, you can select both of them with $('.star'). What you may have been trying to refer to is starts with attribute selector.

Also, I doubt that 1 is a valid class name.

0

精彩评论

暂无评论...
验证码 换一张
取 消