0

我有这个下面的代码

var tempqStr = $("#Qpanel" + item.data("question-id") + " > .questions")[0].innerText

这在Chrome中运行良好,但在Firefox 和 IE中我收到错误内部文本未定义。关于如何使该代码在所有浏览器中工作的任何建议?

4

1 回答 1

0

尝试这个

$("#Qpanel" + item.data("question-id") + " > .questions")[0].text();
于 2014-12-05T06:48:02.637 回答