I have a html file like this:
<!DOCTYPE HTML">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<ul id="a">
<li>list</li>
</ul>
<ul id="b"></ul>
<script type="text/JavaScript" src="js/1.3.2/jquery.min.js"></script>
</body>
</html>
When I load this script:
alert(
jQuery('ul#a li')
.parent()
.clone(true)
.find('li')
.appendTo('#b')
.end()
.end()
.text();
)
It gives me a 1 empty lines. However if I do this:
alert(
jQuery('ul#a li')
.parent()
.clone(true)
.text();
)
It show me "list" on alert box. I expect the two above code is the same, so they should show the same result. Could you explain me why the difference occurred ?
Thank you.