开发者

jquery multiple selector with common tag name

开发者 https://www.devze.com 2023-02-20 21:08 出处:网络
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\')

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

精彩评论

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