Alternate to InnerText in Javascript

We all have used control.innertext property in javascript, but we all know the problem of browsers. Today I came to know that “innertext” property is not working in firefox/safari. what now ? Use “textContent” in lieu of “innertext” property. However “innerHtml” property is working fine with all browsers. COOL :)

E.g. :

var completeText = document.getElementById(‘divText’).textContent; // same as innertext.


About this entry