两种方式
<div id="test">hello, word!</div>
<script type="text/javascript">
var html = document.getElementById('test').innerHTML
var text = document.getElementById('test').innerText
console.log('html', html)
console.log('text', text)
</script>
两种方式
<div id="test">hello, word!</div>
<script type="text/javascript">
var html = document.getElementById('test').innerHTML
var text = document.getElementById('test').innerText
console.log('html', html)
console.log('text', text)
</script>