主頁
HTML
HTML Input 屬性
Tryit:必需的屬性
執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>The input required attribute</h1> <p>The required attribute specifies that an input field must be filled out before submitting the form.</p> <form action="/action_page.php"> <label for="username">Username:</label> <input type="text" id="username" name="username" required> <input type="submit" value="Submit"> </form> </body> </html>