Hi want to create a grid 5 by 5 and fill it randomnly with number using javascript. Can someone help?
techyworld
0
Junior Poster in Training
Recommended Answers
Jump to PostDo you have any code to work with as of yet? I am thinking that you can create a grid using a table or div element, assign each cell a unique id from 0-24.
then, in your JavaScript function, reference each element ID within a for loop and then generate …
Jump to Post@techyworld,
Your script is completely wrong. It does NOT create a 2D array but rather create all-undefined-value array size of 10. But then you wrongly assign a value of 1 using an invalid index (not a number). Because JavaScript always trys to fix the user script, it insteads uses your …
All 7 Replies
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
techyworld
0
Junior Poster in Training
Biiim
182
Junior Poster
techyworld
0
Junior Poster in Training
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
Biiim
182
Junior Poster
Taywin
312
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.