// 检测表单是否填写完整
var check = function() {
var titles=$("#title")
var info=$("#info")
console.log(titles.val())
if ($.trim(titles.val()) === "") {
return "请先填写你的目标";
}
if ($.trim(info.val())=== "") {
return "请先填写你的目标描述";
}
}
document.querySelector(".box-btn").addEventListener('click',function () {
layer.open({
type: 1,
content:$(".target-form").html(),
btn: ['确认', '取消'],
yes: function() {
var result = check();
console.log(1232)
if (result) {
layer.open({
content: result,
skin: 'msg',
time: 2
});
return;
}
})
console.log(titles.val())的时候没有看到值;而不是没有定义
![图片描述][1]
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你这个check怎么使用的不说也不知道啊..
可以取到值的哦!