Created
March 11, 2016 07:54
-
-
Save tanjo/5cc9180a2a5262869676 to your computer and use it in GitHub Desktop.
a タグと img タグの数をカウントするやつ
This file contains hidden or 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 tj_body = document.getElementsByTagName('body')[0]; | |
var tj_d=document.createElement('div'); | |
var tj_t=document.createTextNode('a : ' + document.getElementsByTagName('a').length + ', img : ' + document.getElementsByTagName('img').length); | |
tj_d.appendChild(tj_t); | |
tj_d.setAttribute("style", "background-color:gray;height:20px;display:block"); | |
tj_body.insertBefore(tj_d, tj_body.firstChild); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment