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

JavaScript

Let user type in number of DIV's that will appear on the screen.

Hi, Im trying to make a site, where the user are displayed with an input field, and an open area. The user should be able to write any number in the input field, and then the number of boxes that the user typed in the input field will be displayed in the open area.

So if the user types in 5. 5 div's will be created and then the 5 boxes will then show on the screen. I want to make it using JS, Jquery, html and css. What should I search for on google to get started. I've tried searching for different solutions but havent found anything on it. So does anyone know? Thanks

3 Answers

Steven Parker
Steven Parker
243,656 Points

Have you done the courses here?

I would expect the task you describe to be relatively simple if you've been through the courses here on jQuery and DOM traversal and scriptiing.

Or are you still unsure after having completed those?

have you taken the intro to jQuery class on TH? i think it has everything you would need to do this. you can capture what is typed in an input with the val method and create or cause to appear elements in the DOM from that.

Okey. no I have not completed all of those courses yet! But I will now, hopefully i'll understand it after that. Thanks for your help. I'll ask agian if there is something I dont understand after completed the courses :)