<button id="xj" type="button">获取class中的内容</button>
<button id="rxj" type="button">获取class中的html代码及内容</button>
<button id="txj" type="button">获取input表单中的内容</button>
<div class="anco">
<h1>中国电信</h1>
</div>
<input type="text" id="nb" value="你的手机是18611436777吧" />
<script type="text/javascript">
$(document).ready(function(){//页面加载完在执行jq
$('#xj').click(function(){
alert($('.anco').text())
});
$('#rxj').click(function(){
alert($('.anco').html())
});
$('#txj').click(function(){
alert($('#nb').val())
})
});
</script>