开发者

Help with a regular expression for a jquery selector

Need help writing a regular expression to match any class containing the phrase block-container

I've come up with this: '[class^=block-container]' but I need help writing the wild ca开发者_Python百科rds around the phrase block-container.

Examples i need to match:

 nav-block-container-left
 block-container-whitebox
 right-block-container


$("[class*=block-container]")


You're so close! This is what you want, the *= selector. http://api.jquery.com/category/selectors/

Like this:

$('*[class*=block-container]').fadeOut();

I tested it on a page that has . And then did: $('[class=opmen]').fadeOut();

And it faded out the topmenu div.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜