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
MANUEL CERNA
Courses Plus Student 4,739 PointsCompleted Quiz challenge in the Arrays section. Didn't use last function, called array w/join & tags passed to prnt().
What is the standard when it comes to passing array elements to a web page. Since I did'nt use listHTML variable that was used to build the html list. I was curious if what I did would be a problem in the real world of programming?
1 Answer
Jason Milfred
5,968 PointsI'm not sure if you're looking to only use JavaScript, but most people use JQuery to update html. Of course you definitely can update web pages using only straight JavaScript.
In JQuery you'd identify the HTML element you want to update and then use the html (or append, prepend, etc. depending on what you want to do) method to update it.
$("#my-div").html(html)
MANUEL CERNA
Courses Plus Student 4,739 PointsThanks Jason, I am just learning so am looking for feedback that will further me along with using JS and build on that with other tools such as JQuery. Thanks again.
MANUEL CERNA
Courses Plus Student 4,739 PointsMANUEL CERNA
Courses Plus Student 4,739 PointsHere is my code just to clarify what I did. It really is similar except for the printing of results to webpage.