开发者

jquery javascript question

开发者 https://www.devze.com 2022-12-29 22:53 出处:网络
var val = $(\"#desc\").val();// input box var val2 = $(\"#type\").val();// select box if((val==\'\') || (val2 == \'\'))

var val = $("#desc").val(); // input box var val2 = $("#type").val(); // select box if((val=='') || (val2 == '')) { alert("err"); } else { // codes }

when i select dropdown and not type anything on inputbox, the alert开发者_JAVA百科 err still comes out?

how to make it when dropdown is selected, it goes to else clause?


var val = $("#desc").val();   // input box
var val2 = $("#type").val();  // select box
if((val=='') && (val2 == ''))
     {
     alert("err");
     }
else { // codes }
0

精彩评论

暂无评论...
验证码 换一张
取 消