🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# jQuery 参考手册 - 文档操作 ## jQuery 文档操作方法 这些方法对于 XML 文档和 HTML 文档均是适用的,除了:html()。 | 方法 | 描述 | | --- | --- | | [addClass()](/jquery/attributes_addclass.asp "jQuery HTML - addClass() 方法") | 向匹配的元素添加指定的类名。 | | [after()](/jquery/manipulation_after.asp "jQuery HTML - after() 方法") | 在匹配的元素之后插入内容。 | | [append()](/jquery/manipulation_append.asp "jQuery HTML - append() 方法") | 向匹配元素集合中的每个元素结尾插入由参数指定的内容。 | | [appendTo()](/jquery/manipulation_appendto.asp "jQuery HTML - appendTo() 方法") | 向目标结尾插入匹配元素集合中的每个元素。 | | [attr()](/jquery/attributes_attr.asp "jQuery HTML - attr() 方法") | 设置或返回匹配元素的属性和值。 | | [before()](/jquery/manipulation_before.asp "jQuery HTML - before() 方法") | 在每个匹配的元素之前插入内容。 | | [clone()](/jquery/manipulation_clone.asp "jQuery HTML - clone() 方法") | 创建匹配元素集合的副本。 | | [detach()](/jquery/manipulation_detach.asp "jQuery HTML - detach() 方法") | 从 DOM 中移除匹配元素集合。 | | [empty()](/jquery/manipulation_empty.asp "jQuery HTML - empty() 方法") | 删除匹配的元素集合中所有的子节点。 | | [hasClass()](/jquery/attributes_hasclass.asp "jQuery HTML - hasClass() 方法") | 检查匹配的元素是否拥有指定的类。 | | [html()](/jquery/manipulation_html.asp "jQuery HTML - html() 方法") | 设置或返回匹配的元素集合中的 HTML 内容。 | | [insertAfter()](/jquery/manipulation_insertafter.asp "jQuery HTML - insertAfter() 方法") | 把匹配的元素插入到另一个指定的元素集合的后面。 | | [insertBefore()](/jquery/manipulation_insertbefore.asp "jQuery HTML - insertBefore() 方法") | 把匹配的元素插入到另一个指定的元素集合的前面。 | | [prepend()](/jquery/manipulation_prepend.asp "jQuery HTML - prepend() 方法") | 向匹配元素集合中的每个元素开头插入由参数指定的内容。 | | [prependTo()](/jquery/manipulation_perpendto.asp "jQuery HTML - prependTo() 方法") | 向目标开头插入匹配元素集合中的每个元素。 | | [remove()](/jquery/manipulation_remove.asp "jQuery HTML - remove() 方法") | 移除所有匹配的元素。 | | [removeAttr()](/jquery/attributes_removeattr.asp "jQuery HTML - removeAttr() 方法") | 从所有匹配的元素中移除指定的属性。 | | [removeClass()](/jquery/attributes_removeclass.asp "jQuery HTML - removeClass() 方法") | 从所有匹配的元素中删除全部或者指定的类。 | | [replaceAll()](/jquery/manipulation_replaceall.asp "jQuery HTML - replaceAll() 方法") | 用匹配的元素替换所有匹配到的元素。 | | [replaceWith()](/jquery/manipulation_replacewith.asp "jQuery HTML - replaceWith() 方法") | 用新内容替换匹配的元素。 | | [text()](/jquery/manipulation_text.asp "jQuery HTML - text() 方法") | 设置或返回匹配元素的内容。 | | [toggleClass()](/jquery/attributes_toggleclass.asp "jQuery HTML - toggleClass() 方法") | 从匹配的元素中添加或删除一个类。 | | [unwrap()](/jquery/manipulation_unwrap.asp "jQuery HTML - unwrap() 方法") | 移除并替换指定元素的父元素。 | | [val()](/jquery/attributes_val.asp "jQuery HTML - val() 方法") | 设置或返回匹配元素的值。 | | [wrap()](/jquery/manipulation_wrap.asp "jQuery HTML - wrap() 方法") | 把匹配的元素用指定的内容或元素包裹起来。 | | [wrapAll()](/jquery/manipulation_wrapall.asp "jQuery HTML - wrapAll() 方法") | 把所有匹配的元素用指定的内容或元素包裹起来。 | | [wrapinner()](/jquery/manipulation_wrapinner.asp "jQuery HTML - wrapinner() 方法") | 将每一个匹配的元素的子内容用指定的内容或元素包裹起来。 |