Reputation: 1375
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-"')
, but that does not work.
Thanks in advance.
Upvotes: 0
Views: 78
Reputation: 177
You just need to enclose the class^="some-name-"
in square brackets: ^ in Selector
$('[class^="some-name-"]')
I'm pretty sure that will work.
Upvotes: 4
Reputation: 2503
You need [] in that selector.
jQuery('div[class^="some-name-"]')
try that
Upvotes: 3