Created
June 14, 2013 20:04
Revisions
-
Noah Lively created this gist
Jun 14, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ <html> <body> <a href="javascript:switchDeveloper()">Switch developer</a> <div id="dev-name"></div> <script> var developers = [ 'Nathan', 'Noah', 'Joel', 'Connor', 'Brian' ]; var currentDev = 0; function getCurrentDeveloper() { return developers[currentDev]; } function updateDeveloperDisplay() { var el = document.getElementById('dev-name'); el.innerHTML = getCurrentDeveloper() ; } function switchDeveloper() { currentDev++; if (currentDev >= developers.length) { currentDev = 0; } updateDeveloperDisplay(); } updateDeveloperDisplay(); </script> </body> </html>