How do i replace this static variable $(“#sidebar-button”) with some sort of return variable after i click on the a id=“sidebar-button” link.
I want it so you dont have to write out the entire script differently just to have a j-query popdown menu.
If you would write it a different way please just post that, also correct me if my terminology is in correct.
J-query
<script>
$(document).ready(function() {
$("#sidebar-button").click(function () {
$("#sidebar-toggle1").toggle();
});});
</script>
HTML / PHP
<a id="sidebar-button">link</a>
<div id="sidebar-toggle1">stuff</div>
<a id="sidebar-button">link</a>
<div id="sidebar-toggle2">stuff</div>
an example of this in action would be http://slickdeals.net/. where you click on one of the deals and a dropdown menu appears.