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
area<script language="Javascript"> function blinkit() { intrvl=0; for(nTimes=0;nTimes<3;nTimes++) { intrvl += 200; setTimeout("document.bgColor='#0000FF';",intrvl); intrvl += 200; setTimeout("document.bgColor='#336699';",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
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!