Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Main
- */
- addNewItem('The emptiness ...');
- addNewItem('The grace ...');
- var btnShow = document.getElementById('btn-show');
- btnShow.onclick = showList;
- var btnHide = document.getElementById('btn-hide');
- btnHide.onclick = hideList;
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Functions
- */
- function addNewItem(text) {
- var newItem = document.createElement('a');
- newItem.href = '#';
- newItem.innerHTML = text;
- var theList = document.getElementById('the-list');
- theList.appendChild(newItem);
- }
- function showList(event) {
- var theList = document.getElementById('the-list');
- theList.className = 'dropdown-list shown';
- }
- function hideList(event) {
- var theList = document.getElementById('the-list');
- theList.className = 'dropdown-list hidden';
- }
Add Comment
Please, Sign In to add comment