Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help3403


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
 
Options:
RSS cloud
Jump to:

question about show the things in array in html pages

1 of 419 articles shown, currently no other people reading this forum.
photo
From: Haolin W.
Date: Sat 28th Mar 2020, 9:29pm
Actions: 
        Login-to-reply

 

Hey. It's hard to interpret what exactly you need, but based on your code, I'm 
assuming that you're trying to replace the content of one of your elements with this 
array. Assuming that the element that you're placing the fruits into is empty, you can 
loop over your check array and create fruit elements, and then append them as children 
of the container element (see Lab 4 appendChild).

I've written a quick codepen as an example so you can see what's going on here. Keep 
in mind, this assumes that the container element (in your case, 'demo') is empty.

https://codepen.io/haolinwu/pen/gOpZKbY

There are many ways to tackle this problem, and this solution is only one. Depending 
on your scenario, you could do this much differently.

Let me know how you go.

Related articles

question about show the things in array in html pages (both) RSS
├─ original   Sat 28th Mar 2020, 7:02pm, ANONYMOUS
└─ THIS   Sat 28th Mar 2020, 9:29pm, Haolin W.
This Page


Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020