运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <form action="/action_page.php" method="get"> Name: <input type="text" oninvalid="alert('You must fill out the form!');" name="fname" required> <input type="submit" value="Submit"> </form> <p>If you click submit, without filling out the text field, an alert message will occur.</p> <p><strong>Note:</strong> The oninvalid event is not supported in Safari.</p> </body> </html>