这段代码第十三行错误是因为没有获取到id为top1和top2的元素的值,应该使用document.getElementById("top1").value和document.getElementById("top2").value来获取这两个元素的值。现在的写法会导致top1.value和top2.value为undefined,无法进行加法运算。

这段代码第十三行为什么报错中的错误!DOCTYPE htmlhtmlhead script windowonload = function ifNumbertop1value+Numbertop2value == top3value alert您已经成功了;else alert你彻底失败了; script meta charset=UTF-8 titletit

原文地址: https://www.cveoy.top/t/topic/fxLz 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录