回答編集履歴
1
念のため自動でする処理を追記。
answer
CHANGED
@@ -10,4 +10,16 @@
|
|
10
10
|
|
11
11
|
```JavaScript
|
12
12
|
$('input[type="month"]').addClass('month').focus().removeClass('month');
|
13
|
+
```
|
14
|
+
|
15
|
+
-- 18:26 追記
|
16
|
+
|
17
|
+
```JavaScript
|
18
|
+
$(document).on('focusin', 'input[type="month"]', function(event) {
|
19
|
+
var target = $(this);
|
20
|
+
if (!target.hasClass('month')) {
|
21
|
+
target.addClass('month');
|
22
|
+
requestAnimationFrame(() => target.removeClass('month'));
|
23
|
+
}
|
24
|
+
});
|
13
25
|
```
|