回答編集履歴

1

追記

2016/12/27 07:34

投稿

s8_chu
s8_chu

スコア14731

test CHANGED
@@ -26,9 +26,15 @@
26
26
 
27
27
  $("#text1").on("keyup", function () {
28
28
 
29
- if (input != $(this).text() && input.length > $(this).text().length) {
29
+ var pressedkey = event.keyCode;
30
30
 
31
+ if (pressedkey == 8 || pressedkey == 46) {//8はバックスペース、46はデリートキー。
32
+
33
+ if (input != $(this).text() && input.length > $(this).text().length) {
34
+
31
- alert("何かの文字が消されました。");
35
+ alert("何かの文字が消されました。");
36
+
37
+ }
32
38
 
33
39
  }
34
40