-
-
Save kypflug/bd0e1e04f2a9c0188c63c86278075a9a to your computer and use it in GitHub Desktop.
Top-down analysis sample code
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
// Create the hash tags for the blog articles and format them to fill the sidebar | |
var initializeHashtags = function () { | |
'use strict'; | |
// Add all of the hash tags to the document | |
for (var i = 0; i < getNumTags(); i++) { | |
// create a div for each tag | |
var tag = document.createElement('div'); | |
// Give the tag an id and class | |
tag.id = 'tag-' + i; | |
tag.classList.add('tag'); | |
// Give it some random hashtag text | |
tag.innerHTML = '<p>' + randomText() + '</p>'; | |
// Add the tag to the sidebar | |
document.getElementById(TAGS_DIV).appendChild(tag); | |
// After all of the tags are added, set the width for all of them | |
setWidthOfCells(TAGS_DIV); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment