jQuery slide up and slide down -
by default questions displayed. on clicking 1 of questions related answer has displayed , other answers should hidden. (using slideup , slidedown methods ).
you should use jquery toggle function
<button>toggle</button> <div class="que"> <h4>your question one</h4> <p> answer one!! </p> </div> <div class="que" style="display: none"> <h4>your question two</h4> <p> answer two!! </p> </div> <script> $( "button" ).click(function() { $( ".que" ).toggle( "slow" ); }); </script>
check here http://jsfiddle.net/k13oocfd/
Comments
Post a Comment