Array of images or emoji
Hello everyone! I am new here . Can anyone tell me how can I make an array of emoji or images and then display them in a div on the webpage? **
8 Replies
show us what you have done so far. post your html and js codes and we can guide you properly. if you want someone to write the entire code for you, then chat gpt can you the answer much faster.
lol ¯\_(ツ)_/¯
but yeah it's kinda hard to help you without seeing anything that you've tried to do to solve it
Try setting the div.textContent = emoji
Just a thought since an emoji is just a string. You definitely can't append something to an element though
wdym? that is probably a clearer approach, but
append
(and this solution) works just fine, since append
can also accept a string as an argument. you end up with
Really? It's able to take text as an element in js? Sorry, that was just a little surprising. I apologize, on mobile or else I would have tested it myself
Yeah! I think
appendChild
only takes nodes, but append
takes both :)
i need to brush up on my vanilla js stuff ;-;Good to know! 🙂
+Thanks everyone for your help!