after
英[?ɑ:ft?(r)]? ?美[??ft?(r)]??
prep.…後的;(表示時間)在…以後;(表示位置、順序)在…後面
conj.在…以後
adv.以後,繼後
adj.後來的,以後的
jquery after()方法 語法
作用:after() 方法在被選元素後插入指定的內(nèi)容。
語法:$(selector).after(content
#參數(shù):
說明 | |
必要。規(guī)定要插入的內(nèi)容(可包含HTML 標籤)。 |
##語法: | 使用函數(shù)在被選元素之後插入指定的內(nèi)容。 |
jquery after()方法 範例
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").after("<p>Hello world!</p>"); }); }); </script> </head> <body> <p>This is a paragraph.</p> <button>在每個 p 元素后插入內(nèi)容</button> </body> </html>
#點擊 "執(zhí)行實例" 按鈕查看線上實例