JSFiddle - React, Tailwind, and code Playground

by Daniel Hall

HTML

<button id="replaceButton">files</button>
<div id="body"><p>
no files downloaded
</p></div>
<button id="repButton">pink</button>
<div id="body2"></div>

CSS

body {
    font-family: "Comic Sans MS";
		background-color: black;
}
p {
	  font-size: 3em;
}

#body {
	  position: absolute;
		left: 30%;
		width: 30%;
		height: 30%;
		top: 30%;
		background-color: black;
}

#body2 {
	    position: absolute;
			left: 15%;
			top: 0%;
			width: 30%;
			height: 30%;
			background-color: black;
}

JavaScript

var replaceButton = document
   .getElementById("replaceButton");
replaceButton.addEventListener("click",replaceIt);

function replaceIt(){
 document.getElementById("body")
 .style.backgroundColor = "blue";
 document.getElementById("body")
 .style.backgroundColor = "red"
}