Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

show and hide div tag based on checkbox selection using jquery

<input class="coupon_question" type="checkbox" name="coupon_question" value="1" onchange="valueChanged()"/>

<script type="text/javascript">
    function valueChanged()
    {
        if($('.coupon_question').is(":checked"))   
            $(".answer").show();
        else
            $(".answer").hide();
    }
</script>
 
PREVIOUS NEXT
Tagged: #show #hide #div #tag #based #checkbox #selection #jquery
ADD COMMENT
Topic
Name
6+6 =