Home » Javascript

InnerHtml is not working in FireFox and Safari.

16 June 2009 2 Comments

Few days back while working with “InnerHtml”, I realized that the tag doesn’t work properly for Firefox and Safari.So I tried searching for the solution, by checking the tag against each browser using JavaScript.

I replaced “InnerHtml” with “textContent” (Firefox and Safari) and “innerText” (IE5+) and it worked!

if (document.layers) {
		type="NN";
	} else {
		if (document.all) {
			if (document.getElementById) {
				//type="IE5+";
				var spanTags = document.getElementsByTagName('span');
				for (var i = 0; i

VN:F [1.7.7_1013]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.7_1013]
Rating: 0 (from 0 votes)
Translate this post
        
        
        
        
  

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.