jQuery prepend() 方法
jQuery 教程
· 2019-03-27 16:28:13
实例
在所有 <p> 元素开头插入内容:
$("button").click(function(){
$("p").prepend("<b>Prepended text</b>");
});
定义和用法
prepend() 方法在被选元素的开头插入指定内容。
提示:如需在被选元素的结尾插入内容,请使用 append() 方法。
语法
$(selector).prepend(content,function(index,html))
| 参数 | 描述 |
|---|---|
| content | 必需。规定要插入的内容(可包含 HTML 标签)。
可能的值:
|
| function(index,html) | 可选。规定返回待插入内容的函数。
|
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
Algorithms + Data Structures = Programs
Niklaus Wirth / Prentice Hall / 1975-11-11 / GBP 84.95
It might seem completely dated with all its examples written in the now outmoded Pascal programming language (well, unless you are one of those Delphi zealot trying to resist to the Java/.NET dominanc......一起来看看 《Algorithms + Data Structures = Programs》 这本书的介绍吧!