Like this one:
<div class="abc foo-something">
How can I select div that has a class ending in -something?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
@Einacio commented correct that
$("div[class$='-something']")will not work for<div class="foo-something abc">. To select and this case you can add a second selector, with the following result:$("div[class$='-something'],div[class*='-something ']")This will select and classes that ending with -something and a space follows.
Check this for more info.