<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js">
</script>
<div id="divTest1"></div>
<script type="text/javascript">
$("#divTest1").text("Hello, world!").css("color", "blue");
console.log($("#divTest1").text("Hello, world!"));
</script>
在 chrome->console 中,它显示:[div#divTest1, context: document, selector: "#divTest1", jquery: "1.10.1", constructor: function, init: function…]
这里(http://api.jquery.com/text/)据说:.text() method returns the value of text and CDATA nodes as well as element nodes.
问题:
如何在控制台中找到文本的 te 值?
CDATA 节点和元素节点有什么区别?