:focus सिलेक्टर
फोकस वाले एलिमेंट को सिलेक्ट करने के लिए :focus सिलेक्टर का उपयोग करें।
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
input:focus {
background-color: green;
}
</style>
</head>
<body>
<form action="">
Subject <input type="text" name="subject"><br>
Student: <input type="text" name="student"><br>
Age: <input type="number" name="age"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>