Chat Message with HTML | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Chat Message with HTML

Hello folks, I am coding a webskte that has a chat, but I found a little problem: the user's input. The users can input text messages, images, files and videos and I dunno what tag use in this case. For example, if I put an input, I need to inform the type, so, if the type be "text", the tag will not accept "files" and so on. Please, does someone know how to make the tag identify the message's type and accept it? Should I use javascript? Does input tag the better fpr this case or I should put an <p> tag with "contenteditable" property?

13th Mar 2020, 10:44 AM
Gabriel Felix dos Santos
Gabriel Felix dos Santos - avatar
1 Resposta
+ 4
There is no such thing. You use custom buttons for other types of inputs. You can create a small button next to your input to attach files to the message. It is also impossible to make a chat application with HTML, unless you're planning to talk to youself. Data is saved into a server, and there is no way to do that with HTML and VanillaJS only.
13th Mar 2020, 10:49 AM
Aymane Boukrouh
Aymane Boukrouh - avatar