1) How to programatically (without writing the onclick=”javascript:..” attribute) attach JavaScript (jQuery) function to the link below?
2) The simplest way to toggle hide/unhide after clicking on the Statement link? First click should display the DIV (unhide), the second click should hide it and so forth.
<a>Statement</a>
<div id="taxStatement">insert select statement dropdownbox</div>
You can give the link a class, for example:
Then attach script on
document.readywith.click()and.toggle()the element, like this:You can initially hide the
<div>in multiple ways, CSS:Or give it a class, e.g.
class="toggleDiv"and hide them all the same way:Or also in your
document.ready, via script:You can give it a try/experiment here.