<!DOCTYPE html> <html> <head> </head> <body> <input type="text"> <script> document.querySelector("input").oninput=function(){ document.body.style.backgroundColor = this.value; }; </script> </body> </html>