I'm working within a template using the Cargo Collective platform and it adds unecessary <br />
tags inside the body
of my document.
How can I write a line or two of jQuery to search for every <br />
tag on my page and remove them, or replace them with nothing?
I'm working within a template using the Cargo Collective platform and it adds unecessary <br />
tags inside the body
of my document.
How can I write a line or two of jQuery to search for every <br />
tag on my page and remove them, or replace them with nothing?
- 2 I think you should have a look at jQuery Selectors. – user1823761 Commented Jun 1, 2013 at 6:55
3 Answers
Reset to default 11No doubt, Austins answer is perfect, but if you want, you can also use display: none;
br {
display: none;
}
Demo
You can use the selector br
and .remove()
, like so.
$('br').remove();
JSFiddle
Additionally ,for in a specific div or element
#some_element br {
display: none;
}