回答編集履歴
1
念のため自動でする処理を追記。
test
CHANGED
@@ -23,3 +23,27 @@
|
|
23
23
|
$('input[type="month"]').addClass('month').focus().removeClass('month');
|
24
24
|
|
25
25
|
```
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
-- 18:26 追記
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
```JavaScript
|
34
|
+
|
35
|
+
$(document).on('focusin', 'input[type="month"]', function(event) {
|
36
|
+
|
37
|
+
var target = $(this);
|
38
|
+
|
39
|
+
if (!target.hasClass('month')) {
|
40
|
+
|
41
|
+
target.addClass('month');
|
42
|
+
|
43
|
+
requestAnimationFrame(() => target.removeClass('month'));
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
});
|
48
|
+
|
49
|
+
```
|