Open In App

HTML <blink> Tag

Last Updated : 28 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The HTML <blink> tag was used to create blinking text that flashes slowly. It is now obsolete and unsupported in modern browsers, as it was never standardized. Instead, CSS and JavaScript are recommended for similar effects, although blinking text is generally discouraged for accessibility reasons.

Syntax

<blink> Here is your text that has to blink. </blink>

Note: The <blink> tag is deprecated and not supported in modern browsers. It is advisable to use CSS and JavaScript to achieve similar visual effects if needed but with caution.

Example 1: Deprecated <blink> Tag

This example won’t work as a result of the blink component being deprecated.

html
<!DOCTYPE html>
<html>

<head>
    <title>
        Blinking text using HTML
    </title>
</head>

<body>
    <h1>GeeksforGeeks</h1>
    <blink>
        Blink tag not working
        in HTML
    </blink>
</body>

</html>

Output:

Example 2: Creating a Blinking Effect with JavaScript

In this example we creates a blinking text effect using JavaScript. The <p> element with "Hello Geeks let's Blink" toggles its opacity every second, creating a blink effect.

html
<!DOCTYPE html>
<html>

<head>
    <title>
        Blinking with JavaScript
    </title>
    <style>
        #blink {
            font-size: 20px;
            font-weight: bold;
            font-family: sans-serif;
        }
    </style>
</head>

<body>
    <p id="blink">
        Hello Geeks let's Blink
    </p>
    <script type="text/javascript">
        let blink =
            document.getElementById('blink');

        setInterval(function () {
            blink.style.opacity =
                (blink.style.opacity == 0 ? 1 : 0);
        }, 1000); 
    </script>
</body>

</html>

Output:

Supported Browsers

The <blink> tag is not supported in any modern browser and was never fully standardized. The CSS and JavaScript method shown above will work in all modern browsers.


Next Article

Similar Reads