当前位置:Gxlcms > JavaScript > jquery移动节点实例

jquery移动节点实例

时间:2021-07-01 10:21:17 帮助过:56人阅读

这篇文章主要介绍了jquery移动节点的实现方法,主要涉及append()方法的使用技巧,需要的朋友可以参考下,具体实现方法如下:

方法很方便简单,使用 append()方法即可。代码如下:

<html>
<head>
<title>jquery移动节点</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
 $(function(){
  $("button").click(function(){
   $("p").append($("p"));
  });
 });
</script>
<style type="text/css">
h5{color:blue;}
p{width:300px;height:60px;border:solid 1px green;}
p p{color:red;}
</style>
</head>
<body>
<h5>jquery移动节点</h5>
<button>点我</button>
<p>哈哈哈哈哈哈,太搞笑了</p>
<p>你太幽默了</p>
</body>
</html>

以上就是本章的全部内容,更多相关教程请访问jQuery视频教程!

人气教程排行