Prev Demo
Focus
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title></title> <style> input[type=text]:focus { width: 100%; background-color:pink; color:blue; } </style> </head> <body> <p>Focus in form element:</p> <form> FirstName:<input type="text" id="fname" name="fname"> <br/> <br/> Lastname: <input type="text" id="lname" name="lname"> </form> </body> </html>
Note: We DO NOT save your trial code in our database.
Output