3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JavaScriptを有効にしないとHTMLを見れなくする簡単なコード

Last updated at Posted at 2017-12-24

#はじめに
多くのサイトで公開しているコードでは、div等の要素に入れないと、その部分を見れなくすることができませんが、このコードではhead要素に入れるだけでとても簡単にすべてのHTMLを見れなくすることができます。

<head>
	<style>#load~*{display:none;}</style>
	<div id="load"></div>
</head>

このHTMLは外部CSSにしないで下さい。

document.getElementById(String.fromCharCode(108,111,97,100)).parentNode.removeChild(D.getElementById(String.fromCharCode(108,111,97,100)));

ちなみに、108,111,97,100 はそれぞれ文字コードで load になります。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?