开发者

jquery multiple selector with common tag name

Is there a way by which you can use multiple selectors with common tag name.

So like, here i have $('span.clone1, span.clone2, span.clone3')

i just want to make it common.

Than开发者_StackOverflow社区ks


Here's one way:

var myclasses = [ '.clone1', '.clone2', '.clone3', '.somethingelse' ];
$('span').filter( myclasses.join(',') );
$('input:text').filter( myclasses.join(',') );


If I understand your question something like this would work:

$("span[class^='clone']").blah()
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜