Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

blinking text in html using javascript

<!DOCTYPE html>
<html>

<head>
    <title> Blinking feature using JavaScript </title>
    <style>
        #blink {
            font-size: 20px;
            font-weight: bold;
            color: #2d38be;
            transition: 0.5s;
        }
    </style>
</head>

<body>
    <p id="blink"> This is an example of blinking text using JS. </p>
    <script type="text/javascript">
        var blink = document.getElementById('blink');
        setInterval(function() {
            blink.style.opacity = (blink.style.opacity == 0 ? 1 : 0);
        }, 1500);
    </script>
</body>

</html>
Live Demo ❯
Source by www.w3schools.in #
 
PREVIOUS NEXT
Tagged: #blinking #text #html #javascript
ADD COMMENT
Topic
Name
3+5 =