level 8
点击事件里面获取input和span两个元素 function(){documet.getEle......}
获取input输入的内容,然后和随机数比较。
因为输入是字符,随机数是数字,你要转换成数字比较
判断大小后修改span的innerhtml
2023年11月15日 03点11分
3
level 12
function f() {
let i = parseInt(document.querySelector("input:nth-child(1)").value);
if (i > x) document.querySelector("span").innerHTML = "您猜的数字大了";
// else...
}
2023年11月18日 14点11分
4