您当前的位置: 首页 > 

[JQ权威指南]第八天:复制元素节点

发布时间:2015-07-01 09:11:42 ,浏览量:0

在页面中,创建一个IMG标记,用于显示一幅图片;单击该图片时,在其右侧通过clone()方法复制一幅图片。

 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>复制元素节点title> <script type="text/javascript" src="Jscript/jquery-1.4.2.js"> script> <script type="text/javascript" src="Jscript/jquery-1.4.2-vsdoc.js"> script> <style type="text/css"> img{border:solid 1px #ccc;padding:3px;margin:5px} style> <script type="text/javascript"> $(function() { $("img").click(function() { $(this).clone(true).appendTo("span");
            })
        }) script> head> <body> <span><img title="封面" src="Images/img04.jpg" />span> body> html> 

页面效果: 这里写图片描述

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    105695博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.5176s