专题文章
时长:00:00更新时间:2020-11-27 16:33:34
form表单内的button标签问题_html/css_WEB-ITnose: function save(){ var name = document.getElementById('username').value; alert(name); if(name=='hello'){ history.go(-1); } else{ alert('输入错误 hello'); } } 当button放在form表单里的时候,onclick事件就没有响应,不放在form表单里时,save()方法就得到调用了。 请问,这是什么情况呢?是自动提交了表单
查看详情