Solved

Javascript question for Use W3C standard document.getElementById() instead

Posted on 2011-02-28
2
363 Views
Last Modified: 2012-05-11
Hello experts.
I'm using a javascript function to show/hide panels onclick:
f.e
<script language = "javascript" type="text/javascript">
            function ShowMain() {
                  Main.style.display = "block";
                  DetailsSec.style.display = "None";
                  Options.style.display = "None";
                  Images.style.display = "None";
                  Discounts.style.display = "None";
                  HTMLCode.style.display = "None";
            }
</script>


.......onClick="javascript:ShowMain()"....
<span id = "Main">
......
</span>

i get in firebug a message:
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
 
any help;
0
Comment
Question by:Panos
2 Comments
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 500 total points
ID: 34995660
//you need to do like this..
document.getElementById("Main") .style.display = "block";
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 34995708
Thank you for your help.
regards
panos
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now