insertAfter(content)
将匹配元素集合插入至匹配元素集合‘content’之后。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("p").insertAfter("#foo"); // check after() examples
});
</script>
<style>#foo { background:yellow; }</style>
</head>
<body>
<p> is what I said... </p><div id="foo">FOO!</div>
</body>
</html>
$("p").insertAfter("#foo"); // check after() examples
将匹配p元素集合插入至属性值为‘foo’的匹配元素之后
分享到:
相关推荐
本文实例讲述了jQuery中insertAfter()方法用法。分享给大家供大家参考。具体分析如下: 此方法把匹配的元素插入到另一个指定的元素集合的后面。 insertAfter()方法与insertBefore()方法的作用相反。 语法结构: ...
insertAfter(content) insertBefore(content) 包裹 wrap(html|ele|fn) unwrap() wrapall(html|ele) wrapInner(html|ele|fn) 替换 replaceWith(content|fn) replaceAll(selector) 删除 empty() remove(...
6.2.5 insertAfter(content) 97 6.2.6 insertBefore(content) 97 6.3 包裹 98 6.3.1 wrap(html) 98 6.3.2 wrap(elem) 99 6.3.3 wrap(fn) 99 6.3.4 unwrap() 100 6.3.5 wrapAll(html) 100 6.3.6 wrapAll(elem) 101 ...
$.insertAfter( target ) $.insertBefore( target ) Inserting Around $.unwrap( ) $.wrap( wrappingElement ), .wrap( fn ) $.wrapAll(wrappingElement ), .wrapAll( fn ) $.wrapInner( wrappingElement ), ....
$("元素名称").insertAfter(content); 将该元素插入到content之后 $("元素名称").insertBefore(content); 将该元素插入到content之前 $("元素").prepend(content); 将content作为该元素的一部分,放到该元素的最前面...
jQuery详细教程,讲解很透彻, 一. jQuery 语法实例 $(this).hide() 演示 jQuery hide() 函数,隐藏当前的 HTML 元素。...<p>This is a paragraph with little content. <p>This is another small paragraph. ...
* insertBefore 和 insertAfter 示例说明翻译错误。 + 事件>load 增加注释 2008-06-18 00:05:15 +0800 + $.ajax中新增3个参数,jsonp,password,scriptCharset 2008-06-17 19:43:30 +0800 * 核心>数据缓存> 第三...
insertAfter(content) insertBefore(content) 包裹 wrap(html|ele|fn) unwrap() wrapAll(html|ele) wrapInner(html|ele|fn) 替换 replaceWith(content|fn) replaceAll(selector) 删除 empty() remove(...
insertAfter(content) insertBefore(content) 包裹 wrap(html) wrap(elem) wrapAll(html) wrapAll(elem) wrapInner(html) wrapInner(elem) 替换 replaceWith(content) replaceAll(selector) 删除 empty() ...
insertAfter(content) insertBefore(content) 包裹 wrap(html) wrap(elem) wrapAll(html) wrapAll(elem) wrapInner(html) wrapInner(elem) 替换 replaceWith(content) replaceAll(selector) 删除 empty() ...
本文实例讲述了jQuery插入节点和移动节点的方法。分享给大家供大家参考,具体如下: 1. 插入节点: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <...
get(index) index(subject) 数据缓存 data([name] , [value]) data(obj) removeData(name) $.data([el], [key], [val]) 队列控制 queue(name ,[cb|queue]) dequeue(name) clearQueue([queueName]) 插件机制 jQuery....
* insertBefore 和 insertAfter 示例说明翻译错误。 + 事件>load 增加注释 2008-06-18 00:05:15 +0800 + $.ajax中新增3个参数,jsonp,password,scriptCharset 2008-06-17 19:43:30 +0800 * 核心>数据缓存> 第三...
* insertBefore 和 insertAfter 示例说明翻译错误。 + 事件>load 增加注释 2008-06-18 00:05:15 +0800 + $.ajax中新增3个参数,jsonp,password,scriptCharset 2008-06-17 19:43:30 +0800 * 核心>数据缓存> 第三...
$li_3.insertAfter($two_li); var $one_li=$("ul li:eq(1)"); var $two_li=$("ul li:eq(2)"); $two_li.insertBefore($one_li); $("ul li:eq(1)").appendTo("ul"); $("ul li").remove("li[title!=菠萝]"); $("ul li:...
本文实例讲述了jQuery中insertBefore()方法用法。分享给大家供大家参考。具体分析如下: 此方法把匹配的元素插入到另一个指定的元素集合的前面。 insertBefore()方法与insertAfter()相反。 语法结构: 代码如下:$...