InnerText and textConent usage in javascript

Thursday, June 20, 2013
Now there major browsers always have some stuff different to make life of web developer horrible. On XP with latest IE, InnerText and textConent both work on chrome. Only textConent works Firefox whereas only InnerText works on Internet Explorer. So here is a con to make them work on all browsers.
     document.getElementById('element').innerText = "my text";
} else{
    document.getElementById('element').textContent = "my text";
I haven't tested it on safari but I hope it work for all of you.

1 comment:

sanju said...

very nice article thank you for sharing... Do have a look on 4S IT Solutions. It offers a full range of IT services to support your business infrastructure outside of your data center, too. Visit