Source Code:
(back to article)
Submit
Result:
Report an issue
<div> <pre> <input type="text" id="nameInput" placeholder="Enter Your Name"> <script> document.getElementById('nameInput').addEventListener('focus', function(event) { event.target.style.backgroundColor = 'lightblue'; }); </script> </pre> </div>