Teks berkedip di HTML menggunakan 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 ❯
mathiasgodwin