当我尝试验证以下 HTML 时:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test page</title>
</head>
<body>
<input type="text" name="testInput" value="test value" readonly="readonly" style="background-color: #e3e3e3;">
</body>
</html>
验证器给出错误:
Line 8, Column 118: Attribute readonly not allowed on element input at this point.
但是在错误详细信息中它说:
readonly when type is text, ...
由于这是文本输入,为什么我会收到验证错误?