<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <title>JavaScript Focus Event</title>
</head>
<body>
    <script>
        function highlightInput(elm){
            elm.style.background = "yellow";
        }    
    </script>
    <input type="text" onfocus="highlightInput(this)">
    <button type="button">Tombol</button>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.