473,418 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

How to change DIV IDs onClick

I'm having a problem I have two vertical sliders on the same page that use the same template. My problem is the slider opens on OPEN and closes on CLOSE but it doesnt know which one to do since they are on the same page. Is there a way to change DIV IDs onClick?
Expand|Select|Wrap|Line Numbers
  1. <div class="SliderTool_ViewDocs">
  2.  
  3. <div id="openbutton">
  4.  <a onclick="open$$TOKEN$$();">Open</a>
  5. </div>
  6. <div id="closebutton">
  7.  <a onclick="close$$TOKEN$$();">Close</a>
  8. </div>
  9.  
  10. <script type="text/javascript">
  11. function open$$TOKEN$$() {
  12. var myDiv1 = document.getElementById("openbutton");
  13. myDiv1.style.display = "none";
  14.  
  15. var myDiv2 = document.getElementById("closebutton");
  16. myDiv2.style.display = "block";
  17. }
  18.  
  19. function close$$TOKEN$$() {
  20. var myDiv1 = document.getElementById("openbutton");
  21. myDiv1.style.display = "block";
  22.  
  23. var myDiv2 = document.getElementById("closebutton");
  24. myDiv2.style.display = "none";
  25. }
  26. </script>
  27.  
  28. </div>
  29.  
Any help is appreciated!

Thank you,
RT
Jun 21 '10 #1
0 1079

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ben | last post by:
Is it possible to change the onclick variable after a picture after it has been displayed? e.g similar to image1.src="image.jpg". Basically I have a button that changes 4 images to different...
3
by: delraydog | last post by:
I'm using: document.getElementById("mylink").childNodes.nodeValue = "New Text"; To change the text value of a link that I've created. How can I do something similar to change the onclick...
5
by: VA | last post by:
Firefox 1.0.7 If I launch Jesse Ruderman's Javascript shell http://www.squarefree.com/2005/10/30/javascript-shell-14/ on any web page and type in the shell var mylink for...
2
by: Scott | last post by:
Is it possible to have a button change colour OnClick ? Thanks.
4
by: mark | last post by:
is it possible to change an elements Z-INDEX value on an onclick event in codebehind ? id like to change the posistion of a datagrid once a button has been pressed cheers mark
1
by: tshad | last post by:
Is there a way to change the onClick event of a LinkButton? At the moment, I am using 2 buttons that I toggle the visibility on and off. I would like to use just one button, if possible and just...
7
by: Giacomo | last post by:
I work on a page structured like: <h2> ... </h2> <div ="div1" class="show"> ... </div> <h2> ... </h2> <div id="div2" class="show"> ... </div> <h2> ... </h2> <div id="div3" class="show">...
1
by: fabrice | last post by:
Hello, I d like to modify the Onclik Event of an ImageButton control in code behind. But when i do it , i get an error. This is ma code : The control is the pasx page :
7
by: prash.marne | last post by:
Hello, I have a simple form <form method="POST"> <select name="activity"> <option value="0">None</option> <option value="M" onclick="popup_onclick()">Select Multiple</option> <option...
9
by: shroud77 | last post by:
The general gist here is that I have a cell in a table that I would like to have change background color based on whether or not the checkbox within it is selected or not. The checkbox can be...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.