skwz,
{
let classNamesRE = /^(?:start|stop|status)$/;
let input = document.getElementById("my-field");
let div = document.querySelector(".sos");
let onInputHandler = event => {
let match = (event.code === "Enter" && event.target.value.match(classNamesRE))||"error";
event.target.className = div.className = "sos " + match;
};
input.addEventListener("keyup", onInputHandler);
};