X
Pritisnite ovdje da biste otišli na mobilnu verziju stranice.

Forum podrške

JavaScript innerText problem

Objavljeno

I'm Web Developer and love firefox. I'm using Dreamweaver html engine. I add label in form and when i click the another link to change label text. I try, I search then I apply "document.getElementById("Label1").innerText = "Hello";" code but firefox is not perceive that code. I try Internet Explorer 8 it's detected. Please I love firefox please support that code...

I'm Web Developer and love firefox. I'm using Dreamweaver html engine. I add label in form and when i click the another link to change label text. I try, I search then I apply "document.getElementById("Label1").innerText = "Hello";" code but firefox is not perceive that code. I try Internet Explorer 8 it's detected. Please I love firefox please support that code...

Dodatni detalji o sistemu

Instalirani priključci

  • np-mswmp
  • Shockwave Flash 10.1 r102
  • 4.0.50917.0
  • NPWLPG

Aplikacija

  • Korisnički agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0b6) Gecko/20100101 Firefox/4.0b6

Više informacija

document.getElementById("Label1").innerText = "Hello";

the-edmeister
  • Top 25 Contributor
  • Moderator
5387 rješenja 39986 odgovora

Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox.
http://forums.mozillazine.org/viewforum.php?f=25
You'll need to register and login to be able to post in that forum.

Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br /> http://forums.mozillazine.org/viewforum.php?f=25 <br /> You'll need to register and login to be able to post in that forum.
cor-el
  • Top 10 Contributor
  • Moderator
17276 rješenja 156150 odgovora

Korisan odgovor

If it is a problem with a Firefox 4.0 beta version then you need to post in the Firefox Builds forum

See http://forums.mozillazine.org/viewforum.php?f=23

innerText is IE only. Firefox does support innerHTML, but not innerText.

You can use textContent for Firefox: document.getElementById("Label1"). textContent = "Hello";

http://blog.coderlab.us/2005/09/22/using-the-innertext-property-with-firefox/

If it is a problem with a Firefox 4.0 beta version then you need to post in the Firefox Builds forum See http://forums.mozillazine.org/viewforum.php?f=23 innerText is IE only. Firefox does support innerHTML, but not innerText. You can use textContent for Firefox: document.getElementById("Label1"). textContent = "Hello"; http://blog.coderlab.us/2005/09/22/using-the-innertext-property-with-firefox/

Izmjenjeno od strane cor-el

Vlasnik pitanja

Thank you. I try document.getElementById("Label1"). innerHTML = "Hello"; and it's done. Thanks..

Thank you. I try document.getElementById("Label1"). innerHTML = "Hello"; and it's done. Thanks..
ibrahim.cse15 0 rješenja 1 odgovora
Objavljeno

my innerHTML code is perfectly run in IE and mozilla beta version..its user agent is (rv 1.9.2.6)Gexxko/20100625 Firefox/3.6.6........but not working in Mozilla version 5 user agent is rv(2.0b1)Gecko/2010630 FireFox/4.0b1....i dont know the error..can u help me

my innerHTML code is perfectly run in IE and mozilla beta version..its user agent is (rv 1.9.2.6)Gexxko/20100625 Firefox/3.6.6........but not working in Mozilla version 5 user agent is rv(2.0b1)Gecko/2010630 FireFox/4.0b1....i dont know the error..can u help me
cor-el
  • Top 10 Contributor
  • Moderator
17276 rješenja 156150 odgovora
Objavljeno

Both versions that you listed are outdated versions and have been replaced by newer versions Firefox 3.6.12 and Firefox 4.0 b7.

Did you try the latest Firefox 4.0 beta7 version?

Both versions that you listed are outdated versions and have been replaced by newer versions Firefox 3.6.12 and Firefox 4.0 b7. Did you try the latest Firefox 4.0 beta7 version? * http://www.mozilla.com/firefox/all-beta.html
nileshp@iprogrammer.com 0 rješenja 3 odgovora
Objavljeno

Hi, I m facing the java script problem like: "innerhtml " not works in IE8 and innerText Problem in mozilla firefox.

I want both browser to compatible solution if any one has then please guide me....


Thanks, Nilesh Pangul

Hi, I m facing the java script problem like: "innerhtml " not works in IE8 and innerText Problem in mozilla firefox. I want both browser to compatible solution if any one has then please guide me.... Thanks, Nilesh Pangul
nileshp@iprogrammer.com 0 rješenja 3 odgovora
Objavljeno

Yes i got the solution,

Use the uger agent of browser and user the innerText for IE and innerHTML for mozilla.. Thats it..


Thanks,

Nilesh Pangul

Yes i got the solution, Use the uger agent of browser and user the innerText for IE and innerHTML for mozilla.. Thats it.. Thanks, <h1>Nilesh Pangul</h1>
nileshp@iprogrammer.com 0 rješenja 3 odgovora
Objavljeno

Korisan odgovor

Hi Friends, If InnerHTML is not working in IE and InnerText is not working in Mozilla Then, Use the bellow code navigator.userAgent.indexOf. Please check the example bellow,

//Code for Internet Explorer if(navigator.userAgent.indexOf('MSIE')!=-1) { window.document.getElementById('DisSelStatesCat').innerText ="("+countStates+") State(s) selected."; } else { //code for other browsers window.document.getElementById('DisSelStatesCat').innerHTML ="("+countStates+") State(s) selected."; }

Thanks,

Nilesh Pangul

Hi Friends, If <b>InnerHTML is not working in IE and InnerText is not working in Mozilla</b> Then, Use the bellow code navigator.userAgent.indexOf. Please check the example bellow, //Code for Internet Explorer if(navigator.userAgent.indexOf('MSIE')!=-1) { window.document.getElementById('DisSelStatesCat').innerText ="("+countStates+") State(s) selected."; } else { //code for other browsers window.document.getElementById('DisSelStatesCat').innerHTML ="("+countStates+") State(s) selected."; } Thanks, <h1>Nilesh Pangul</h1>