搜索框为空时阻止搜索

This commit is contained in:
底层用户 2022-08-19 14:13:17 +08:00
parent 6f48c6ed2d
commit 35ba36660a

View File

@ -143,8 +143,10 @@ $(window).keydown(function (e) {
//点击搜索按钮 //点击搜索按钮
$(".sou-button").click(function () { $(".sou-button").click(function () {
if ($("body").attr("class") === "onsearch") { if ($("body").attr("class") === "onsearch") {
if ($(".wd").val() != "") {
$("#search-submit").click(); $("#search-submit").click();
} }
}
}); });
//控制台输出 //控制台输出