![](https://i-blog.csdnimg.cn/blog_migrate/99b7758c19dfaec195d2722d3f6533ee.jpeg)
var obj = $("#testdiv")//JQ
//获取innerText
var innerText = obj[0].innerText || obj[0].textContent;//兼容了火狐
//设置innerText
obj.html(innerText);
var obj = $("#testdiv")//JQ
//获取innerText
var innerText = obj[0].innerText || obj[0].textContent;//兼容了火狐
//设置innerText
obj.html(innerText);
转载于:https://www.cnblogs.com/hucaihao/p/3614485.html