html
<p>p</p>
<br>br1
<br>br2
<br>br3
I got 3 times alert instead of 1, why? since
$( function() {
console.log($('p').text());
$( 'br' ).each( function() {
if(this.nextSibling.nodeValue = 'br1'){
alert('found');
}
});
});
what I want to do is delete that line if nodevalue found, like delete <br>br1
if br1 can be found.