编辑下面的代码:【加编码】
<html> <head> <style> input:focus { background-color:yellow; } </style> </head> <body> <form action="demo-form.php" method="get"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="Submit"> </form> <p><b>Note:</b> IE8 supports the :focus pseudo-class only if a !DOCTYPE is specified.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂