var titles = document.getElementsByTagName('p'); var arr = document.getElementsByTagName('ul') for(var i = 0;i<titles.length;i++){titles[i].id = i;titles[i].onclick=function(){for (var k= 0; k < titles.length; k++) {arr[k].id = k;arr[arr[k].id].className = '';}arr[this.id].className = 'active';} }
// 计时开始
timer = setInterval(countDown,1000);
function countDown(){
send.value = `${times}秒后重试`;
if(times>=0){
times -= 1;
send.disabled = true;
}else{
send.value = "发送验证码";
send.disabled = false;
clearInterval(timer);
}
}
timer = setInterval(countDown,1000);
function countDown(){
send.value = `${times}秒后重试`;
if(times>=0){
times -= 1;
send.disabled = true;
}else{
send.value = "发送验证码";
send.disabled = false;
clearInterval(timer);
}
}
最新回答 / qq_云上_0
<!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> * { margin: 0; padding: 0; list-style: none; } .wrap { height: 170px; width: 490px;...
2020-07-09
最新回答 / VictoryLang
提示为空,说明你没有获取到正确的DOM元素,用console.log检查下。window.onload=function(){ var menu = document.getElementById('menu'); var item = menu.getElementsByTagName('div'); for(var i = 0; i < item.length; i++) { item[i].onclick = function() { ...
2020-03-24