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 = "發(fā)送驗證碼";
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 = "發(fā)送驗證碼";
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