Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The focusin Event</h2>
Enter your name: <input type="text" onfocusin="myFunction(this)">
<p>When the input field gets focus, a function changes the background-color.</p>
<script>
function myFunction(x) {
  x.style.background = "yellow";
}
</script>
</body>
</html>