jQuery unexpected identifier error -
jquery code:
$("#projecttype").change(function(){ alert($("#projecttype").val()); if($("#projecttype").val() == '16' || $("#projecttype").val() == '17' || $("#projecttype").val() == '18' || $("#projecttype").val() == '19' || $("#projecttype").val() == '20' ||response $("#projecttype").val() == '21' || $("#projecttype").val() == '22' || $("#projecttype").val() == '23' || $("#projecttype").val() == '24' || $("#projecttype").val() == '25' || $("#projecttype").val() == '26' || $("#projecttype").val() == '27'){ $("#bhkshow").hide(); alert('if'); } else{ $("#bhkshow").show(); } })
it's displaying unexpected identifier
error in console. how can resolve error?
try this:
$("#projecttype").change(function(){ var projectvalue = $("#projecttype").val(); alert(projectvalue); if(projectvalue == '16' || projectvalue == '17' || projectvalue == '18' || projectvalue == '19' || projectvalue == '20' || projectvalue == '21' || projectvalue == '22' || projectvalue == '23' || projectvalue == '24' || projectvalue == '25' || projectvalue == '26' || projectvalue == '27'){ $("#bhkshow").hide(); alert('if'); } else{ $("#bhkshow").show(); } });
Comments
Post a Comment