How to append after selection
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?
Use the .after() method:
$( '#test' ).after ( '<br/>' );
$('#test').after('<br />');
That what you are after?
精彩评论