textContent 与 innerText 之间的区别 - Difference between textContent vs innerText

问题:

What is the difference between textContent and innerText in JavaScript? JavaScript 中的textContentinnerText什么区别?

Can I use textContent as follows:我可以使用textContent如下:

var logo$ = document.getElementsByClassName('logo')[0];
logo$.textContent = "Example";

解决方案:

参考一: https://stackoom.com/question/2NkXz
参考二: Difference between textContent vs innerText
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章