我最近建立了一個網頁,讓我更多地瞭解HTML,而且我發現'required'
屬性。我將它添加到了字段中,但它沒有做任何事情。「必要」的屬性不工作
誰能告訴我,我的「需要」屬性的錯誤?
我希望它說:「請填寫此場」時,該字段爲空
<html>
<head>
<link href="icon.ico" rel="icon">
<title>Log In</title>
</head>
<body>
<h1 align="center">Welcome to site</h1>
<hr width="50%"/>
<br/>
<table align="center">
<form>
<tr>
<td>Log In : </td>
<td><input type="text" name="LogInEmail" placeholder="Enter your email" required></td> </tr><tr>
<td>Password : </td>
<td><input type="password" name="password" placeholder="Password" required></td>
</tr>
</form>
</table>
<br/>
<table align="center">
<form>
<tr>
<td><input type="submit" value=" Log In "/></td>
</tr>
</form>
</table>
</body>
</html>
您好,請提供您的期望和實際結果使社區可以幫助您與您的「錯誤」(你沒有描述)。 – Gildas
我只是想,如果任何一個領域的未填充比我想消息「請填寫此場」 @Gildas –
的可能的複製[HTML5必要屬性不工作(http://stackoverflow.com/questions/17791818/HTML5要求的屬性 - 不工作) – JumpingJezza