Created
July 10, 2015 14:21
-
-
Save chuck0523/f3469c94f6b47243ceab to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,user-scalable=no,maximum-scale=1" /> | |
<title>cssDisplayResearch</title> | |
<script type="text/javascript" src="jquery.min.js"></script> | |
<link rel="stylesheet" type="text/css" href="tags.css"> | |
</head> | |
<body> | |
<div id="tagContainer" class="tagContainer"> | |
</div> | |
<script> | |
$(document).ready(function(){ | |
var log = function(x) {console.log(x);} | |
var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p', 'br', 'hr', 'address', 'em', 'strong', 'del', 'ins', 'abbr', 'acronym', 'dfn', 'sup', 'sub', 'blockquote', 'q', 'cite', 'pre', 'code', 'var', 'kdb', 'samp', 'bdo', 'a', 'base', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'img', 'table', 'thead', 'tfoot', 'tbody', 'tr', 'th', 'td', 'colgroup', 'col', 'frameset', 'frame', 'noframes', 'iframe', 'form', 'label', 'fieldset', 'legend', 'input', 'textarea', 'button', ]; | |
var generateTags = function() { | |
var tagsCon = $('#tagContainer'); | |
var tagsSize = tags.length; | |
for(var i = 0; i < tagsSize; i ++) { | |
var tag = $('<' + tags[i] + ' />'); | |
tagsCon.append(tag); | |
} | |
}; | |
var listenTagDisplay = function() { | |
var allTags = $('#tagContainer *'), | |
tagsSize = allTags.size(); | |
for(var i = 0; i < tagsSize; i++) { | |
var tag = $(allTags[i]), | |
tagName = tag.prop('tagName').toLowerCase(); | |
log(tagName + '\'s display is ' + tag.css('display')); | |
} | |
}; | |
generateTags(); | |
listenTagDisplay(); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment