0

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?

leppie
  • 115,091
  • 17
  • 196
  • 297
  • Check [`Niet the Dark Absol answer`](http://stackoverflow.com/a/22990890/769678) for this question [Why Is Inner Text Not Working In Firefox](http://stackoverflow.com/questions/22990812/why-is-innertext-not-working-in-firefox) – Shubh Dec 05 '14 at 06:46

1 Answers1

0

Try this

$("#Qpanel" + item.data("question-id") + " > .questions")[0].text();
erakitin
  • 11,437
  • 5
  • 44
  • 49
Tomer Almog
  • 3,604
  • 3
  • 30
  • 36