Created
June 28, 2012 16:12
-
-
Save yamitake/3012225 to your computer and use it in GitHub Desktop.
lessquelton prototype
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 result = {}; | |
| function dive(elem , arr){ | |
| if(!arr)arr = {}; | |
| arr[elem.get(0).tagName.toLowerCase()] = {} | |
| elem.children().each(function(){ | |
| dive($(this) , arr[elem.get(0).tagName.toLowerCase()]); | |
| }); | |
| return arr; | |
| } | |
| function indent(depth){ | |
| var tab = ""; | |
| for(var i = 0; i < depth; i++){ | |
| tab += " "; | |
| } | |
| return tab; | |
| } | |
| var aaa = dive($("header"));//要素を指定 | |
| aaa; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment