开发者

How to append after selection

开发者 https://www.devze.com 2023-01-27 02:47 出处:网络
I am trying to append some code after my current selection, lets say I have this: <div id="test">

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

精彩评论

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