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';} }
2020-12-18
老師,自動(dòng)播放的定時(shí)器加了,選項(xiàng)卡延時(shí)的功能沒有了,這兩個(gè)功能應(yīng)該一起實(shí)現(xiàn)啊
2020-09-09
// 計(jì)時(shí)開始
timer = setInterval(countDown,1000);
function countDown(){
send.value = `${times}秒后重試`;
if(times>=0){
times -= 1;
send.disabled = true;
}else{
send.value = "發(fā)送驗(yàn)證碼";
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ā)送驗(yàn)證碼";
send.disabled = false;
clearInterval(timer);
}
}
2020-08-19
最新回答 / 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
最新回答 / 慕夢前來
是沒有計(jì)算好個(gè)數(shù)
最新回答 / 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