Work with value?

Want when widely in the field input type="text" the word "open", the button color changes to green. Prior to that he red.
April 3rd 20 at 18:57
1 answer
April 3rd 20 at 18:59
Solution
// inputElem your field
inputElem.addEventListener("change", e => {
 // btn enter themselves
 btn.style.backgroundColor = e.target.value === 'open' ? 'green' : 'red';
});

Find more questions by tags JavaScript