DEV Community

Cover image for How To: Create A Random Number Generator w. JavaScript

How To: Create A Random Number Generator w. JavaScript

Amy Oulton on January 07, 2022

Today we're going to build out a random number generator using JavaScript. Random number generators are a fantastic beginner JavaScript project. Yo...
Collapse
 
enkrateiaofcode profile image
IBRAHIM

I followed the steps and checked my code many times but when I click on generate a number nothing happens! still figuring out why.

Collapse
 
amyoulton profile image
Amy Oulton

Send me the code and I'll check it over!

Collapse
 
enkrateiaofcode profile image
IBRAHIM

Thank you so much for your time. A quick question can I attach the files here?

Thread Thread
 
amyoulton profile image
Amy Oulton

Nope. Either make a public GitHub repo or a codepen and attach the link!

Thread Thread
 
enkrateiaofcode profile image
IBRAHIM
Thread Thread
 
amyoulton profile image
Amy Oulton

It's a crazy simple error! The id you assigned to the number in your HTML file is Number, but in your javascript file you're searching for an id with number. JS is case-senstive. Change the casing and you should be good!

Thread Thread
 
enkrateiaofcode profile image
IBRAHIM

Now is working lol. Thank you so much Amy!

Thread Thread
 
amyoulton profile image
Amy Oulton

No problem!

Collapse
 
marcosrjjunior profile image
Marcos RJJunior

Super simple and effective

Collapse
 
amyoulton profile image
Amy Oulton

Thanks!

Collapse
 
cseiter profile image
cseiter

Saw your use of Schitt's Creek gifs. insta-follow.