append
English [??p?nd]
vt. ??(??) ??;
jquery ??() ??? ???
??: append() ???? ??? ??? ?(?? ??)? ??? ??? ?????. Append() ? AppendTo() ???? ??? ??? ?????. ???? ???? ???? ?????.
??: ??$(selector).append(content)
????:
Parameters | Description |
content | ?????. ??? ???? ?????(HTML ?? ?? ??). ??? ???? ???? ?????. |
??: ??$(selector).append(function(index,html))
????:
Parameters | Description |
function(index,html ) | ???. ??? ??? ???? ??? ?????. |
index | ????. ???? ??? ??? ????. |
html | ????. ???? ?? HTML? ????. |
jquery ??() ??? ?
<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").append(" <b>Hello world!</b>"); }); }); </script> </head> <body> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>在每個(gè) p 元素的結(jié)尾添加內(nèi)容</button> </body> </html>
??? ????? ??? "???? ??" ??? ?????