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 6689089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:28:43+00:00 2026-05-26T05:28:43+00:00

I am trying to do a basic if/else statement to display or hide content

  • 0

I am trying to do a basic if/else statement to display or hide content within a table. It’s also important to note that this content is being fed from an XML document. I am looking for an XML tag called .

I have the following code and cannot figure out how to make this work. Whatever I try, it displays nothing on the page. My logic seems right, but I’m also not a great script writer; so any guidance would be greatly appreciated. Thank you for your time and help.

n = xmlDoc.getElementsByTagName("note")[0].childNodes[0].nodeValue

if (n != NONE){
        document.write("<tr>");
    document.write("<td colspan='4' id='notation'>");
    document.write(y[j].getElementsByTagName("note")[0].childNodes[0].nodeValue);
    document.write("</td>");
    document.write("</tr>");
}else{
    document.getElementsByTagName("note").style.display = 'none';
    }
}

….or what if I toggle the visibility of a div on and off?:

if (none != NONE){
document.write("<div id='test' style='background-color: #999;'>")
    document.write(y[j].getElementsByTagName("note")[0].childNodes[0].nodeValue);
document.write("</div>");
}else{
    document.getElementById('test').style.display = 'none';
}
  • 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-26T05:28:44+00:00Added an answer on May 26, 2026 at 5:28 am

    For those interested, my condition was incorrect. It should have been something like this:

    (y[j].getElementsByTagName("note")[0].childNodes[0].nodeValue != "NONE")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying a very basic XPath on this xml (same as below), and it
I'm trying to create a basic system that will allow only specific users to
This is a very basic example of what I am trying to implement in
I'm trying to make a basic multiprocessing task and this is what I have.
I'm trying out this basic authentication using jQuery. But nothing happens when I enter
Reduced to basic form, I'm trying to do something like this with a binary
My basic problem is that I'm trying to re-merge trunk and a branch in
I was trying to write this basic JavaScript program which changes the background color
I am digging into LINQ--trying to understand basic models (it seems pretty cool to
Im trying to get into some basic JavaFX game development and I'm getting confused

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.