位置:首頁 > 軟件操作教程 > 編程開發(fā) > HTML > 問題詳情

html代碼大全 用javascript代碼來實現(xiàn)閃爍按鈕

提問人:劉團圓發(fā)布時間:2020-11-02

<body> 

<form method="POST" action="--WEBBOT-SELF--"> 

<input type="button" name=SUB value="閃爍" id=flashit style="BORDER: 1px solid ;BACKGROUND-COLOR: #FFFFFF"> 

</form> 

<script> 

if (document.all&&document.all.flashit) 

var flashelement=document.all.flashit 

if (flashelement.length==null) 

flashelement[0]=document.all.flashit 

function changecolor(which) 

if (flashelement[which].style.color==`#800000`) 

flashelement[which].style.color="#0063A4" 

else 

flashelement[which].style.color="#800000" 

if (flashelement.length==null) 

setInterval("changecolor(0)",1000) 

else 

for (i=0;i<flashelement.length;i++) 

var tempvariable=`setInterval("changecolor(`+i+`)",`+`1000)` 

eval(tempvariable) 

</script> 

</body> 

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部