javascript - How to select elements (using jQuery) that have the class attribute with a value beginning exactly with a given string? -
i have following elements:
<div class="some-name-1"></div> <div class="some-name-2"></div> <div class="some-name-3"></div> <div class="other-name-1"></div> <div class="other-name-2"></div>
i need next elements:
<div class="some-name-1"></div> <div class="some-name-2"></div> <div class="some-name-3"></div>
i tested jquery('class^="some-name-"')
, not work.
in advance.
you need [] in selector.
jquery('div[class^="some-name-"]')
try that
Comments
Post a Comment