Maison >interface Web >tutoriel HTML >:button中文字闪烁_html/css_WEB-ITnose
刚开始学习,想触发一事件,引起按钮中的文字闪烁,能实现网页上其它字的闪烁,却操作不了按钮中的文字
代码如下:只能实现按钮旁边的文字武汉闪烁,不能改变按钮中的武汉
<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