Last active
October 21, 2017 02:21
-
-
Save jonsamp/28823ef8b791de8538d875012776ac05 to your computer and use it in GitHub Desktop.
JavaScript Tips Tab: generateTip III
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
// Tip Limit counter | |
var tipLimit = 3; | |
// Generate a number | |
function generateNumber() { | |
... | |
} | |
// Generate a tip: | |
// 1. Get random number from generateNumber() | |
// 2. Use the random number to get the tip from the array | |
// 3. Show the tip | |
function generateTip() { | |
var tip = tipsList[generateNumber()]; | |
var tipElement = document.querySelector('.js-tip'); | |
var tipLimitCount = document.querySelector('.tip-limit-count'); | |
tipElement.innerHTML = tip; | |
tipLimitCount.innerHTML = tipLimit; | |
} | |
... | |
// Get the first tip | |
generateTip(); |
Did you unzip the folder when you download it
WassimaG, did you save the changes in the text editor?
I'm stuck too, why are the answers from the earlier steps not translating to this?
me too, have double checked all my entries and can't find the problem. And yes, I have unzipped the file and I have saved the file in my text editor (Atom)
I had the same challenge... but I noticed the page displayed correctly on firefox developer edition... because I used es6 let
to declare the variables, so I changed them to var
and the page displayed on chrome...
so you might wanna try tweaking your file a bit to see what works...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote everything properly but nothing appears when I re-open the html file on chrome. It's like all my changes on java file aren't connected to the html despite the source file being on the html file. Can you help please?