<!DOCTYPE html> <html> <body> <h1>JavaScript 验证</h1> <form action="/index/demo/form_current.html" method="post"> <input type="text" name="fname" required> <input type="submit" value="提交"> </form> <p>如果您点击提交,而不填写文本字段,浏览器将显示错误消息。</p> </body> </html>