asp.net mvc - Cross browser compatibility issue for showing and hiding div -
i have mvc app.
i have written below code in js in create view. on basis of selection on drop down show , hide div. problem below code works in google chrome , mozilla firefox. working in ie 8.
what should ?
$('#paymenttype').change(function(){ var ptype=document.getelementbyid("paymenttype").value; if(ptype=="on account") { $(".invoicediv").hide(); } else { $(".invoicediv").show(); } });
i not sure real issue since using jquery why don't use ptype, too? this, cross-browser issue minimized (if not avoided).
$('#paymenttype').change(function(){ var ptype = $(this).val(); ... });
hope helps.
Comments
Post a Comment