Saturday, January 28, 2012

How to use blink() Method in JavaScript

    The blink() method is used to display a blinking string.
    The blink() method only works in Firefox and Opera. It is not supported in Internet Explorer, Chrome etc.
 
Syntax: string.blink();
 
JavaScript code:
<script language="javascript" type="text/javascript">

    function BlinkFunction() {
        var myString = new String('Am I blinking?');
        document.write(myString.blink());
    }

</script>
 
Html code:
<button onclick="this.BlinkFunction();">Blink</button>

No comments: