Home >Web Front-end >HTML Tutorial >How to use button trigger to achieve background color flashing

How to use button trigger to achieve background color flashing

php中世界最好的语言
php中世界最好的语言Original
2018-02-08 09:51:133426browse

This time I will show you how to use the button to trigger the flashing of the background color. What are the precautions for using the button to trigger the flashing of the background color. The following is a practical case. Let’s take a look.

To achieve the background color flashing effect, just add the following code to the 6c04bd5ca3fcae76e30b72ad730ca86d area

  <script language="Javascript"> 
  function blinkit() 
  { 
   intrvl=0; 
   for(nTimes=0;nTimes<3;nTimes++) 
   { 
   intrvl += 200; 
   setTimeout("document.bgColor=&#39;#0000FF&#39;;",intrvl); 
   intrvl += 200; 
   setTimeout("document.bgColor=&#39;#336699&#39;;",intrvl); 
   } 
  } 
  </script> 
  <input type="button" value="Blink" onClick="blinkit()">

I believe you have mastered the method after reading these cases, please come for more exciting Pay attention to other related articles on php Chinese website!

Related reading:

How to upload files asynchronously in html

The margin-top element in the div tag is invalid Solution

#iframe node initialization

The above is the detailed content of How to use button trigger to achieve background color flashing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn