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
  • 112,162
  • 17
  • 191
  • 293
  • 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,231
  • 5
  • 41
  • 48
Tomer Almog
  • 3,120
  • 2
  • 28
  • 32