var obj = $("#testdiv")//JQ

//获取innerText
var innerText = obj[0].innerText || obj[0].textContent;//兼容了火狐

//设置innerText
obj.html(innerText);