Cross browser issue with inner text

48 Views Asked by At

I have this below code

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

This works fine in Chrome but in Firefox and IE I get an error inner text is undefined.Any suggestions on how to make that code work in all the browsers?

1

There are 1 best solutions below

0
On

Try this

$("#Qpanel" + item.data("question-id") + " > .questions")[0].text();