开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜