append

English [??p?nd]

vt. ??(??) ??;

jquery ??() ??? ???

??: append() ???? ??? ??? ?(?? ??)? ??? ??? ?????. Append() ? AppendTo() ???? ??? ??? ?????. ???? ???? ???? ?????.

??: ??$(selector).append(content)

????:

ParametersDescription
content ?????. ??? ???? ?????(HTML ?? ?? ??). ??? ???? ???? ?????.

??: ??$(selector).append(function(index,html))

????:

ParametersDescription
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>
???? ?? ?

??? ????? ??? "???? ??" ??? ?????