闪光的链接

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function blinklink()
  5. {
  6. if (!document.getElementById('blink').style.color)
  7. {
  8. document.getElementById('blink').style.color="red"
  9. }
  10. if (document.getElementById('blink').style.color=="red")
  11. {
  12. document.getElementById('blink').style.color="black"
  13. }
  14. else
  15. {
  16. document.getElementById('blink').style.color="red"
  17. }
  18. timer=setTimeout("blinklink()",100)
  19. }
  20.  
  21. function stoptimer()
  22. {
  23. clearTimeout(timer)
  24. }
  25. </script>
  26. </head>
  27.  
  28. <body onload="blinklink()" onunload="stoptimer()">
  29. <a id="blink" href="/index.html">闪烁的链接</a>
  30. </body>
  31.  
  32. </html>