Akorede
Akorede

Reputation: 1

How can I get a user input and display it on a single page for my chat app

I am working on a chat web app just like Whatsapp and I have created a form where users can type a message but after doing that, I have a problem with making a users input display on a single page but it's displaying on a new page please how can I do that. I use the document.write()

I used a document.write() method but It's showing me what I am not expecting. What I need is to display input on a single page, not on another page

Upvotes: 0

Views: 137

Answers (1)

Jim
Jim

Reputation: 675

document.write is old and even strongly discouraged. You should append a new element to part of your page.

document.createElement would work well.

Upvotes: 1

Related Questions