How add an element in a list with JS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How add an element in a list with JS

7th Apr 2022, 3:17 PM
Creator75
Creator75 - avatar
3 Answers
0
1. Get the list object you want to append to 2. Get the object you want to append 3. Append that object to the list object You'll need to use some id's in the HTML, some querySelectors in the JS, and a button to run your function. This should be enough to get you started.
8th Apr 2022, 6:45 PM
Sam
0
We have à list and with à button we can add an element of thé list
7th Apr 2022, 4:01 PM
Creator75
Creator75 - avatar
0
<select> <option>A</option> <-- and here I add an element of the list with JS </select>
7th Apr 2022, 4:03 PM
Creator75
Creator75 - avatar