View Full Version : Resolved Blink tag in javascript

05-16-2012, 09:35 AM
Hiya guys,
I was just wondering about the html blink tag. I know it doesnt work in all browsers, but I also know that you can acheive the same effect using javascript, so would you guys possibly be able to teach me some javascript that would do the equivalent of a blink tag for all browsers?

05-16-2012, 09:57 AM
<!DOCTYPE html>
<script type="text/javascript">
var blinkLength = 500;
function blink1(){
document.getElementById('div1').style.display = "block";
function blink2(){
document.getElementById('div1').style.display = "none";
<body onload="blink1()">
<div id="div1">Div Text</div>

Here's a simple example. When the page loads, the function blink1() is called. This then sets the divs style.display to block (visible).

It then waits 500 miliseconds before triggering blink2(). This then sets the divs style.display to none (invisible).

The variable var blinkLength = 500; is the number of miliseconds you want it to wait inbetween hides/unhides.

Hope this helps.

P.s. - Welcome to the forums bernie1227 ;)

05-16-2012, 10:11 AM
If this thread is finished, please set it to resolved.
You can do this by editing the first post within the thread - Pressing go advanced - Then where it says no prefix, selecting resolved then save.