我正在尝试解决这个问题,但我对JavaScript相对较新,因此:
函数termos()返回一个true或false的结果;
可能解决这个问题很简单,但我无法想到。这可以实现吗?我只是为了举例说明我的疑问写了这段代码。
function termos() {
if($('.terms').is(':checked')) {
return true;
} else {
return false;
}
}
我可以使用
} else if(termos() === false) {
alert('please agree with terms');
return false;
}
这行代码不起作用
please agree with terms
上缺少一个闭合引号。 - Michael Berkowski