javascript - Radio button clicks change function -
we have 2 radio buttons when change button need call function. below code.
<input id="ordertype" type="radio" align="top" name="ordertype" value="new order" checked=""> <input id="ordertype" type="radio" align="top" name="ordertype" value="additional order (add items previous order)">
jquery code
jquery(document).ready(function(){ $('input:radio[name="ordertype"]').change(function(){ if($(this).val() === 'additional order (add items previous order)'){ var removepages = 'boothlightingdiv'; }else{ var removepages = 'furnishingsprovideddiv'; } }); });
call function togglediv('boothsizediv', removepages);
based radio button need change togglediv function parameter.any help?
i this:
http://jsfiddle.net/bobrierton/5lc17p1t/1/
$(document).on('change', 'input[name=ordertype]', function() { var value = $(this).val(); if (value == "additional order (add items previous order)") { //whatever trying var removepages = 'boothlightingdiv'; }else{ //or whatever trying var removepages = 'furnishingsprovideddiv'; } alert(removepages) });
Comments
Post a Comment