<1>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://localhost:41928/Jquery/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
//.thml()是在块中加html代码
$("div").html("<a href='http://www.baidu.com'>百度</a>");
alert($("div").text()); //输出是是一个百度的超链接
})
$(function () {
//.text()是在块中的文字
$("div").text("<a href='http://www.baidu.com'>百度</a>");
alert($("div").text()); //输出的是 【<a href='http://www.baidu.com'>百度</a>】这么一段文字
})
</script>
</head>
<body>
<div></div>
</body>
</html>
http://blog.sina.com.cn/s/blog_561be372010008ev.html
$().thml()与$().text()的区别,布布扣,bubuko.com
原文地址:http://blog.csdn.net/fanbin168/article/details/38186569