Menu ▼



Posted By :
avatarmrkraju
Total Views : 5472

Blinking text using JavaScript.

           

Source Code :

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>Blink Text using JavaScript</title></style>

    <script language="javascript">

        setInterval(blinktext, 500);

        var txt = "";

        var count = 0;

        function blinktext() {

            var cntrl = document.getElementById("txtblinkingtext");

            if (count == 0)

                txt = cntrl.value;

            if (count % 2 == 0)

                cntrl.value = "";

            else

                cntrl.value = txt;

            count++;

        }

    </script>

</head>

<body>

    <form id="form1" runat="server">

    <div style="margin: auto; text-align: center;">

        <input type="text" id="txtblinkingtext" name="txtblinkingtext" value="Blinking Text"

            readonly="readonly" style="height: 20px; width: 100px; background-color: Red;

            color: White; border: 0px none; text-align: center;">

    </div>

    </form>

</body>

</html>

 

 






comments powered by Disqus


Search dotnetlearners.com