Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

show and hide div tag based on checkbox selection using javaScript

<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>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #show #hide #div #tag #based #checkbox #selection #javaScript
ADD COMMENT
Topic
Name
9+1 =