質問編集履歴

2

スペルの誤入力

2019/04/04 14:04

投稿

Res
Res

スコア184

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  <div id="bookmark">
18
18
 
19
- <input type="button" name="" value="この記事をブックマーク" onclick="bookmark()" id="bookumark">
19
+ <input type="button" name="" value="この記事をブックマーク" onclick="bookmark()" id="bookmark">
20
20
 
21
21
  </div>
22
22
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  if (value === 'on') {
32
32
 
33
- document.getElementById('bookumark').value = 'ブックマークを解除';
33
+ document.getElementById('bookmark').value = 'ブックマークを解除';
34
34
 
35
35
  function bookmark(){
36
36
 
@@ -46,7 +46,7 @@
46
46
 
47
47
  localStorage.setItem(code, 'on');
48
48
 
49
- document.getElementById('bookumark').value = 'ブックマークを解除';
49
+ document.getElementById('bookmark').value = 'ブックマークを解除';
50
50
 
51
51
  }
52
52
 

1

スペルはミスです。onclick=""は大丈夫だったのですが...

2019/04/04 14:03

投稿

Res
Res

スコア184

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  <div id="bookmark">
18
18
 
19
- <input type="button" name="" value="この記事をブックマーク" onclick="bookmark()" id="bokkumark">
19
+ <input type="button" name="" value="この記事をブックマーク" onclick="bookmark()" id="bookumark">
20
20
 
21
21
  </div>
22
22
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  if (value === 'on') {
32
32
 
33
- document.getElementById('bokkumark').value = 'ブックマークを解除';
33
+ document.getElementById('bookumark').value = 'ブックマークを解除';
34
34
 
35
35
  function bookmark(){
36
36
 
@@ -46,7 +46,7 @@
46
46
 
47
47
  localStorage.setItem(code, 'on');
48
48
 
49
- document.getElementById('bokkumark').value = 'ブックマークを解除';
49
+ document.getElementById('bookumark').value = 'ブックマークを解除';
50
50
 
51
51
  }
52
52
 
@@ -71,5 +71,3 @@
71
71
  Chrome最新版でやってます。
72
72
 
73
73
  ローカルストレージの内容を読み取って表示するページはできています。
74
-
75
- jqueryは使わないでください。