Currently, when I add another link, it automatically uses the same functionality as the toggle button. What I want is for "Toggle Edit Mode" to toggle a hidden div on and off. I attempted to modify the code from $("a").click(function ()
to $("toggle").click(function ()
, and changed
<a>Toggle Edit Mode</a>
to Toggle Edit Mode, but it didn't work. Any suggestions?
Here is the HTML:
<li><a>Toggle Edit Mode</a>
</li>
<div class="hidden rightButton">hello</div>
CSS:
.hidden {
display: none;
}
.unhidden {
display: block;
}
JavaScript:
$(document).ready(function () {
$("a").click(function () {
$("div").toggleClass("hidden unhidden");
});
});