源代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <form action="demo-form.php" accept="image/gif, image/jpeg"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> Your image: <input type="file" name="pic" id="pic"><br> <input type="submit" value="提交"> </form> <p><b>注意:</b>几乎所有的主流浏览器都不支持 accept 属性。</p><hr> <form action="demo-form.php" accept-charset="ISO-8859-1"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="提交"> </form> </body> </html>
运行结果:
Fmpq工具