form表单内的button标签问题_html/css【点击查看详情】
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()方法就得到调用了。 请问,这是什么情况呢?是自动提交了表单
相关视频/文章