JSFiddle - React, Tailwind, and code Playground

by fjorgemota

HTML

<!DOCTYPE HTML>
    <html>
        <head>
            <meta http-equiv="content-type" content="text/html" />
            <meta name="author" content="gencyolcu" />
            <title>Untitled 1</title>            
        </head>

        <body>

            <div id="m">kfjgflg</div>

            <script type="text/javascript">
                function changeColor(){
                    document.body.style.backgroundColor = "red";
                }
                var x=document.getElementById("m");
                if(!!x.addEventListener){ //If exists
                    x.addEventListener("click", changeColor);
                }
                x.onclick = changeColor; //It's a property, and ALWAYS can be set (but in some cases is not recognized)
            </script>
        </body>
    </html>