<html>
<head>
<style>
input:focus {
background-color: yellow;
}
</style>
</head>
<body>
<p>Click inside the text fields to see a yellow background:</p>
<form>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</form>
<p><b>Note:</b> For :focus to work in IE8, a DOCTYPE must be declared.</p>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_focus by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:11:40 GMT -->
</html>