我有以下代码片段。我希望在单击“选择”输入字段时在“更改”事件期间运行一些代码。如果所选选项的值为零,我想中止而不执行剩余的代码。这是代码段:
$select.on('change',function(){
var newYear = this.value;
if(this.value === 0){
studentDiv.hide();
//I would like to return from here,and not execute any remaining code..
}else{
那么,如何从发表评论的地方“返回”?键入
return;
似乎没有任何作用... 最佳答案
我觉得这个问题可能还有更多,因为您在评论中回答了它。
return;