0

I want to create a tread of messages for bot

I want to take user input then display it and then if user write anything else I want to display it also on same page. If I use document.write function which only write and then hide every other thing. Like in WhatsApp, hike chat thread are made like that. See the tag please tell how to do it in javascript.

10th Nov 2020, 6:47 PM
Charchit Dahiya
Charchit Dahiya - avatar
1 Réponse
0
I think you could build your text thread with something like this: var textThread = document.getElementById("textThread"); node = document.createTextNode(enteredText); textThread.appendChild(node); (textThread is a div id)
11th Nov 2020, 5:09 AM
Brian
Brian - avatar