Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
amirbizimana
9,639 PointsMultiple functions for one click event ?
In the codepen below I'm looking to test out a quote generator that generates a new quote and a new color simultaneously when you click the New quote button. However its only firing the nColor() function. I set a click event holding 2 functions to generate the random quote nQuote() and one to generate the random color nColor(). Am I making this more complicated than it ought to be ?
1 Answer
Justin Roberts
14,583 PointsLooks like they're running two functions within another function. So have your onclick handler fire a function, then within that function have two other functions.