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/
Depending on your particular use-case, you could try the attribute prefix selector:
It seems from your sample data that "grap" is always prefixing the class, so if that's the case this may be what you want. If "grap" can be anywhere in the class instead of just at the beginning, use *= instead.
Use the "attribute contains" selector: http://api.jquery.com/attribute-contains-selector/
The "attribute contains word" selector won't work because, according to the docs, it finds elements where the specified attribute contains the given word delimited by spaces.
You want to use the "Attribute contains selector", not the "Attribute contains WORD selector", which is what you linked to.
What you're looking for is the "attribute contains selector"
See an example here http://jsfiddle.net/CsvUY/
Use the attribute contains selector: