I have a function written to open / close a div using a placeholder for a hyperlink.
<a class="button" onclick="show('click-drop')">Open</a>
The onclick
event then opens the div.
I have this onclick
to close it:
<a class="button" onclick="hide('click-drop')">Close</a>
What I would like to do is have a single placeholder for a hyperlink that switches between the two onclick
events. So onclick=show
would switch to onclick=hide
and vice versa.
I have looked everywhere and cannot find a straightforward solution for my situation.
I appreciate any feedback.