How to append after selection
10,040
Solution 1
Use the .after() method:
$( '#test' ).after ( '<br/>' );
Solution 2
$('#test').after('<br />');
That what you are after?
Author by
Admin
Updated on June 04, 2022Comments
-
Admin almost 2 years
I am trying to append some code after my current selection, lets say I have this:
<div id="test">
</div>
and want to append <br /> after closing div, like this
<div id="test">
</div>
<br />
Is there a way to do this?
-
Jan Hančič over 13 yearsI removed my vote after you edited it. It was wrong, so I down voted :)
-
benhowdle89 over 13 yearshow come its still on a "-1" !?