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.
精彩评论