最新回答 / HiramWong
document.write直接输出了 return才是回调 你这样写直接执行了document.write 而后面语句由于函数没有回填值所以就输出未定义
2020-02-18
while(content.childNodes.length>0){content.removeChild(content.childNodes[content.childNodes.length-1]);}
主要是在于方法,至于循环不一定要用for
主要是在于方法,至于循环不一定要用for
2020-02-16
最赞回答 / 慕尼黑1441384
最简洁的代码:<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><script type="text/javascript"> var w=window.innerWidth || document.documentElement.clientHeight...
2020-02-16
已采纳回答 / 慕的地7636881
你这个错误有点多。。。一:文本框写的 id='fruit' ,设置结果输入框值写的是 friut ,改成 fruit ;二:switch 有两处错误,case 后面写错了,resuslt 的那几行语句后面没有用分号结尾;下面是改好了测试过的,你对比一下<!DOCTYPE html><html> <head> <title> 事件</title> <script type="text/javascript"> f...
2020-02-14
var getValues = document.getElementById('count').innerHTML;
function counts(){
getValues--;
document.getElementById('count').innerHTML = getValues;
setTimeout(this.counts,1000);
if (getValues == 0) {
location.href="http://baidu.com";
}
}
setTimeout(counts,1000);
function counts(){
getValues--;
document.getElementById('count').innerHTML = getValues;
setTimeout(this.counts,1000);
if (getValues == 0) {
location.href="http://baidu.com";
}
}
setTimeout(counts,1000);
最新回答 / 慕的地6574030
var j=document.getElementById("wb").value;//是获取wb里面的值赋值给j(即输入框中输入的值) var hobby = document.getElementById("hobby"+j); //"hobby"+j是前面id对应的hobby1-6; //document.getElementById("hobby"+j)是获取id=hobby j; hobby.checked =...