+ 1

How can I make a new div and span at Same time onclick?

I want to make WhatsApp clone so, when user send message the message display in new div Like this:- https://code.sololearn.com/WQtik6Ry8usl/?ref=app But in simple way

17th Jan 2023, 3:16 PM
Kaushal
Kaushal - avatar
3 ответов
+ 5
I see you are aware of createElement() and appendChild() as you have used them in that code. So what's the problem with creating new <div> and <span>? Also why reposting this? you already get a response in previous post https://www.sololearn.com/Discuss/3183867/?ref=app
17th Jan 2023, 3:49 PM
Ipang
+ 3
Create a button. Attach a function to the button. Whenever the button is clicked, create a new element and append it to the body or whatever you use as a container for the new elements. As Ipang mentioned, do not re-post the same question. If you need help with your code, please link your *own* code.
17th Jan 2023, 4:43 PM
Lisa
Lisa - avatar
0
That was not response
17th Jan 2023, 3:51 PM
Kaushal
Kaushal - avatar