回答編集履歴

1

:invalid

2022/07/25 21:54

投稿

int32_t
int32_t

スコア20987

test CHANGED
@@ -1,7 +1,15 @@
1
1
  > * Value属性で例を示すのは違うと思う
2
2
 
3
3
  `value` 属性でいいと思いますよ。
4
- ```js
4
+ ```html
5
5
  <input value="@example.com" style="color:gray" oninput="this.removeAttribute('style')">
6
6
  ```
7
7
 
8
+ `:invalid` を使ってもいいかもしれませんね。
9
+ ```html
10
+ <style>
11
+ :invalid { color: gray }
12
+ </style>
13
+ <input type=email value="@example.com">
14
+ ```
15
+