


















function(index, html)A function that returns an HTML string to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments.
群里有人问,写个简单的demo
1: <script type="text/javascript">
2: $(function() {
3: $("li").append(function(index, html) {
4: if (index == 3) {
5: html += "new append";
6: }
7: return html;
8: });
9: });
10: </script>
11:
12: <ul><li>111</li><li>22</li><li>33</li><li>44</li></ul>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。