Last active
August 29, 2015 14:02
-
-
Save ww24/479804935b724b615b3f to your computer and use it in GitHub Desktop.
.lightgray 要素の前に半角空白を挿入し、 .lightgray 要素を削除する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* コピペ防止対策☆ | |
*/ | |
var fakes = [].slice.call(document.getElementsByClassName("lightgray")), fake; | |
while (fake = fakes.shift()) { | |
fake.parentNode.insertBefore(document.createTextNode(" "), fake); | |
fake.parentNode.removeChild(fake); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
メモ: 途中で要素数が変わる処理の場合、 Array#forEach では全ての要素が走査されない問題が現れる