我有时会看到这样的东西:
<input name="star2" type="radio" class="star 1"/>
<input name="star2" type="radio" class="star 2"/>
是可能的在jQuery让一个类来处理这两个类?因为它们有相同的父类,哪个是* ?如果可能的话,我该怎么做呢?使用正则表达式?
是的,您可以使用$('.star')
同时选择它们。您可能一直试图引用的是以属性选择器开头。
同样,我怀疑1
是一个有效的类名。