Select div (or other element) that class contains “grap” (o other specified word) for example
First of all; example of HTML code: <div class"grap1"> some conetent</div> <div class"grap2"> some conetent</div> <div class"grap3"> some conetent</div> <div class"blabla">some content></div> And now i want to select divs that class contains "grap" word somewhere is class name (so in this case first three divs). How can i achieve that ? This is not working: http://api.jquery.com/attribute-contains-word-selector/ Use the attribute contains selector : $('div[class*="grap"]') Depending on your particular use-case, you could try the attribute prefix selector: var $grapDivs = $('div[class|="grap"]'