SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Simple Show/Hide Question
-
Aug 28, 2006, 05:28 #1
Simple Show/Hide Question
I'm new to this whole javascript malarkey, and I'm trying to make a div show when a button is pressed. The code I'm using is as follows, but its not working...
In <head> section
Code:<script type="text/javascript"> function showDiv(id) { div = document.getElementById(id); div.style.display = "block"; } </script>
Code:<p><a href="#" title="Waste-Some-Time.com - Links By Category" onclick="showDiv("catdets")">Links By Category</a></p> <div id="catdets" style="display:none"> <div class="linkcontainer"> <a href="#">Cartoons</a> </div> <div class="linkcontainer"> <a href="#">Games</a> </div> </div>
Thanks for your time,
Alex
-
Aug 28, 2006, 05:38 #2
- Join Date
- Mar 2004
- Posts
- 1,647
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
use single quotes inside the function when you call it
Bookmarks