JSFiddle - React, Tailwind, and code Playground

by Lalji Tadhani

HTML

<div class="container">
    <h1>
        <div class="hello" id="hello1" onmouseover="changeText()" onmouseout="this.innerHTML='Hello.';">Hello.</div>
    </h1>
</div>

CSS

.container {
        margin-top: 6vw;
        margin-left: 40%;
        margin-right: 40%;
}

JavaScript

function changeText() {
        if (document.getElementById("hello1")) {
            a = document.getElementById("hello1")
            a.innerHTML = '<a href="https://www.google.com">Google</a>'
        }
    }