The following source is created dynamically.
I’d like to add
<br />
after Artikler, to become
Artikler<br />.
Source
<div id="shopping">
<p><!--TEXT:--> <A HREF="cart-8.asp" CLASS="longsum">7 Artikler, verdi: 10 199,00</A></p>
</div>
I think I need to use
.after('<br />');
but I am not sure how to get Artikler.
7 will be changed dynamically.
The jQuery DOM manipulation functions (such as
after()) work specifically on DOM elements, and in this case your entire block of text is a single element.A better approach is to get the text out of the element:
Then do your string replace:
and put the result back into the element: