Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6943957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:13:24+00:00 2026-05-27T13:13:24+00:00

So my problem is Firefox doesn’t recognize .innerText which is used to retrieve the

  • 0

So my problem is Firefox doesn’t recognize .innerText which is used to retrieve the current users name and added to the URL. This works in Safari, Chrome, and IE, but not Firefox. It returns “undefined”

function toggle_visibility( id ) { 

var url = 'http://widget.mibbit.com/?settings=46780594e96e435ff18e44e48b7d880d&ser‌ver=irc.Mibbit.Net&channel=%23yourCh&nick=',
        username = document.getElementsByClassName( 'user-nickname' )[0].innerText;
    document.getElementById( 'chat' ).setAttribute( 'href', url + username );

So I found this solution for Firefox that needs to be added.

if(document.all){
     document.getElementsByClassName( 'user-nickname' )[0].innerText;
} 

else{
    document.getElementsByClassName( 'user-nickname' )[0].textContent;
}

I need help using the .textContent to retrieve the username in Firefox and still use .innerText also. I’m hoping it’s going in the right direction!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:13:25+00:00Added an answer on May 27, 2026 at 1:13 pm

    Don’t check for document.all to use innerText.

    Also, the official property is textContent. You should prioritise that when you check.

    var elem = document.getElementsByClassName( 'user-nickname' )[0],
        text = elem.textContent || elem.innerText;
    

    text will contain the text nodes joined for the element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Google Chrome doesn't seem to have this problem, I noticed this in Firefox. So
How do you get around this Ajax cross site scripting problem on FireFox 3?
I have a Firefox 3.6.2 problem (3.5.x works just fine). This is the code:
I have a problem with the following code, which doesn't want to work in
I have been unable to figure out this problem - it just doesn't make
This is a weird issue, it works in IE but it doesn't in Firefox.
I’m having a setTimeout problem similar to this one . But that solution doesn't
I have a weird problem, this URL won't load in internet explorer 7 or
This is my code, which sometimes works and sometimes doesn't. var resolve_ajax_login=function(){ $.ajaxSetup({cache:false });
I've some CSS problem in Firefox 3. I have several image buttons on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.