源代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <form action="demo-form.php" method="get"> <fieldset name="personalia"> Name: <input type="text" name="usrname"><br> Email: <input type="text" name="email"><br> </fieldset> <button type="button" onclick="form.personalia.style.backgroundColor='yellow'">改变控件的背景颜色</button> <input type="submit"> </form> <p><b>注意:</b>除了 Internet Explorer,其他主流浏览器都支持 name 属性。</p> </body> </html>
运行结果:
Fmpq工具