<!DOCTYPE html>
<html>

  <body>

    Enter your name:
    <input type="text" onfocus="myFunction(this)">
  
    <p>When the input field gets focus, a function is triggered which changes the background-color.</p>
  
    <script>
      function myFunction(x) {
        x.style.background = "yellow";
      }
    </script>

  </body>

</html>
// Code goes here

/* Styles go here */