JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="subEmail">

JavaScript

function checkFilled() {
	var inputVal = document.getElementById("subEmail").value;
	if (inputVal == "") {
		inputVal.style.backgroundColor = "yellow";
				}
		}