質問するログイン新規登録

回答編集履歴

1

情報の追加。

2018/05/08 06:58

投稿

kei344
kei344

スコア69638

answer CHANGED
@@ -4,4 +4,6 @@
4
4
  var hoge = document.querySelector('div');
5
5
  console.log(hoge.textContent.length,encodeURIComponent(hoge.textContent));
6
6
  // 5 "%0A%20%20A%0A"
7
+ console.log(hoge.textContent.trim().length,encodeURIComponent(hoge.textContent.trim()));
8
+ // 1 A
7
- ```**動くサンプル:**[https://jsfiddle.net/tkazcxce/](https://jsfiddle.net/tkazcxce/)
9
+ ```**動くサンプル:**[https://jsfiddle.net/tkazcxce/1/](https://jsfiddle.net/tkazcxce/1/)