Javscript Code for Bliking Text in HTML

Puneet20884
Posted by Puneet20884 under JavaScript category on | Views : 1606
Suppose you want to give Blinking to "Click Here"
you will add the following code to your html
<blink>Click Here</blink>


but in some of the browser you will not see the text blinking.
So for this please add the following code to the head of you page :

<script language="javascript" type="text/javascript">
function doBlink() {
var blink = document.all.tags("BLINK")
for (var i=0; i<blink.length; i++)
blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function startBlink() {
if (document.all)
setInterval("doBlink()",500)
}
window.onload = startBlink;
</script>


You will notice the effect in all the browsers.

Thanks,
-Puneet

Comments or Responses

Login to post response