刚开始学习,想触发一事件,引起按钮中的文字闪烁,能实现网页上其它字的闪烁,却操作不了按钮中的文字
代码如下:只能实现按钮旁边的文字武汉闪烁,不能改变按钮中的武汉
<html><head><meta charset=utf-8></head><body style="background-color:rgba(230,255,255,0.5); font-family:'幼圆';"><span id="blink"><input id="btn" type="button" style="cursor:hand; width:60px; height:30px; text-align:center;" value="武 汉" onclick="window.location.href='test.html'"/>武汉</span><script type = "text/javascript" >function blinklink() { if (!document.getElementById('blink').style.color) { document.getElementById('blink').style.color = "black"; document.getElementById('btn').style.color = "black"; } if (document.getElementById('blink').style.color == "black") { document.getElementById('blink').style.color = "#FFFFFF"; document.getElementById('btn').style.color = "transparent"; } else { document.getElementById('blink').style.color = "black"; document.getElementById('btn').style.color = "black"; } timer = setTimeout("blinklink()", 500);}function stoptimer() { clearTimeout(timer);} blinklink()</script> </body></html>http://bbs.csdn.net/topics/391000303?page=1
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号