Last active
January 27, 2017 14:25
-
-
Save SabbaKilam/63d5d869d38531553adbbfbba4f6a6c3 to your computer and use it in GitHub Desktop.
Show Todos
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
/** | |
Show Todos | |
*/ | |
body{ | |
background-color: lightgray; | |
user-select: none | |
} | |
#holder{ | |
position: absolute; | |
margin: auto; | |
width: 75%; | |
height: 50%; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
background-color: teal; | |
border-radius: 0.5rem; | |
box-shadow: 5px 5px 15px #555; | |
color: white; | |
overflow-y: scroll; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HTML5, CSS3 and JavaScript demo</title> | |
</head> | |
<body> | |
<center> | |
<div id="holder"></div> | |
</center> | |
</body> | |
</html> |
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 holder = document.querySelector('#holder'); | |
var todos = [ | |
"Really learn objects", | |
"Get better at JavaScript", | |
"Do the laundry", | |
"Make dinner", | |
"Massage your feet", | |
"The last item in the list" | |
]; | |
function showTodo(todo){ | |
var div = document.createElement('div'); | |
div.innerHTML = todo; | |
holder.appendChild(div); | |
} | |
holder.innerHTML = ""; | |
todos.forEach(showTodo); |
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
{"view":"split-vertical","fontsize":"150","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment