JSFiddle - React, Tailwind, and code Playground

by johannpickard

HTML

<!DOCTYPE html>
<html>
<body>

<p id="demo">Click the button to change the color of this paragraph.</p>

<button onclick="myFunction()">Try it</button>

</body>
</html>q

JavaScript

function myFunction() {// THe function goes and fetches an HTML element in the document by the ID is it given in the HTML
  var x = document.getElementById("demo");
  
// Then we go and edit the proteries of this variable and clieck execute , Which edits the properties of the HTML element with that ID 
  x.style.color = "red";}