[Solved] JQuery Toggle()


<a href="https://stackoverflow.com/questions/12033712/javascript:void(0)" onClick="random_script('#somediv',1000);">Show Results?</a>
<div id="somediv" style="display:none;"></div>

Alternative with JQuery (jsfiddle):

<script type="text/javascript">
    ​$('.showResult')​.click(function (){
        $(this).next('.result').toggle();
    });​​​​​​
</script>
<style>
    ​.result {
        display: none;
    }​
</style>

<a href="https://stackoverflow.com/questions/12033712/javascript:void(0)" class="showResult">Show Results?</a>
<div class="result">Some Result​​​​​​​​​​​​​​​​​​​​​​​​​​</div>​​​​​​​​​​​​​​​​​​​​​​

4

solved JQuery Toggle()