jQuery append() 方法
jQuery 教程
· 2019-03-27 11:27:52
实例
在所有 <p> 元素结尾插入内容:
$(document).ready(function(){
$("#btn1").click(function(){
$("p").append(" <b>插入文本</b>.");
});
$("#btn2").click(function(){
$("ol").append("<li>插入项</li>");
});
});
定义和用法
append() 方法在被选元素的结尾插入指定内容。
提示:如需在被选元素的开头插入内容,请使用 prepend() 方法。
语法
$(selector).append(content,function(index,html))
参数 | 描述 |
---|---|
content | 必需。规定要插入的内容(可包含 HTML 标签)。
可能的值:
|
function(index,html) | 可选。规定返回待插入内容的函数。
|
点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html
C++ How to Program (5th Edition) (How to Program)
Harvey & Paul) Deitel & Associates / Prentice Hall / 2005-01-05 / USD 98.00
With over 250,000 sold, Harvey and Paul Deitel's C++ How to Program is the world's best-selling introduction to C++ programming. Now, this classic has been thoroughly updated! The Deitels' groundbreak......一起来看看 《C++ How to Program (5th Edition) (How to Program)》 这本书的介绍吧!