cut string after third occurence of element with jquery
I got a string as follows:
<p class="remove">
This should go:
<br>
this too
<br>
<br>
from here on I want it to stay
<br>
blabla
<br>
blabla
</p>
I want to cut the first part until the third occurence of br away with
jquery.
I know that I can get it by the split function, but I can't get it to get
the third br element as the selector.
Here is my code so far:
var replace = $('.remove').text();
alert(replace.split('br:nth-child(3)')[1]);
No comments:
Post a Comment