here is the problem and its really really killing me becauseit probably has a very simple solution. check out this jsfiddle
<body>
<p>
this is the first paragraph and it will get the prepend without any problems at all
</p>
<span>
this is a simple span element, and it will also get the prepend without any problems at all
</span>
<em>
heres a em and this works as well
</em>
<p>
here is another para and it works , BUT NOW LOOK AT THE NEXT LINE
<br>BR STARTS HERE
where is this prepend, ladies and gentlement,,NADA.
</br>
</p>
$("*", document.body).each(function () {
$(this).prepend('<b><font color="red"> soccer </font></b>');
});
you will find a simple set of HTML tags just a few randomly placed <p>
and <span>
tags.
I have written a small jquery (2 lines function) that loops through all the tags in the body of the page and prepends a piece of html to each tag.
Unfortunately, the <br>
tags do not seem to follow what all the other tags follo. It does not get the prepended HTML and I just can't figure it out.
or
to break to a new line. – Derek Feb 15 '13 at 15:49
is used alone. In XHTML, you must use it as
. But it does not wrap content like most other tags. It operates alone. – Pete Feb 15 '13 at 15:50