JavaScript DOM树更新innerHTML排序问题

时间:2019-02-15 23:06:34

标签: javascript

我有:

let mysterious = document.querySelector('.mystery')
console.log(mysterious)
mysterious.innerHTML = 'xxx'
console.log(mysterious)
<h2 class='mystery'>Riddle</h2>

控制台显示:

<h2 class="mystery">xxx</h2>
<h2 class="mystery">xxx</h2>

为什么第一个控制台日志不是<h2 class="mystery">Riddle</h2>

0 个答案:

没有答案