jquery clone

源码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>无标题文档</title>
<style type="text/css">
.center
{
width
:960px;
margin
:0 auto;
border
:1px solid #333;
background-color
:#ccc;
}
</style>

<script src="js/jquery.min.js" language="javascript" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(
function() {
alert($(
'#me').html());

var obj = $('#me').find("#widget").clone();

//obj.html("123");

obj.html(
"123");

obj.appendTo($(
'.me'));
});
</script>
</head>

<body>

<div id="me" style="display:none">
<div id="widget">test</div>
</div>

<div class ="me"></div>
</body>
</html>

  

  

posted @ 2011-09-06 11:45  wangkangluo1  阅读(713)  评论(0编辑  收藏  举报