text()方法捕获div的文本
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function()
{
$("#demo2").click(function(){
alert($("#demo1").text())
})
})
</script>
</head>
<body>
<div id="demo1">hello jquery dom</div>
<button id="demo2">点击显示文本</button>
</body>
</html>
text(“xxxx”)方法修改文本
效果类似于innerhtml
$("#demo3").click(function(){
$("#demo1").text("hello the world")
})