jQuery API 返回首页目录 | jQuery API 中英文对照版
add(html)
add(html)

向匹配的元素集合中添加更多动态创建的元素。

返回值:jQuery

参数:

  • html (String): 动态创建元素的HTML代码字符串

示例:

$("p").add("<span>Again</span>")

HTML 代码:

<p>Hello</p>

结果:

[ <p>Hello</p>, <span>Again</span> ]

 
add( html )

Adds more elements, created on the fly, to the set of matched elements.

Return value: jQuery
Parameters:

  • html (String): A string of HTML to create on the fly.

Example:

 $("p").add("<span>Again</span>")  
Before:
 <p>Hello</p>  
Result:
 [ <p>Hello</p>, <span>Again</span> ]  

 

相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog