I'd like to remove all <br/>
<br />
or <br>
tags from #id p
. I tried $('#id p').find('br').remove();
but it doesn't seem to work.
I tried out this example, and it worked for me:
<html>
<head>
<title>Test!</title>
<script src="jquery-1.3.2.js"/>
</head>
<body>
<div id="foobar">
<p>
This is <br/> some <br/> text.
</p>
</div>
<input type="button" value="Click" onclick="$('#foobar p').find('br').remove();"/>
</body>
</html>
Is there anything different from what you are trying to do?
The best way to do it would be...
$('#id p br').remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With