I am afraid what you are attempting to do is going to take more than just some HTML. You typically need a place to store messages temporarily so that people you are chatting with can see your messages. To get them into this storage place you usually need a server-side language like PHP or ASP.
The series usually goes, you type into a textbox and hit the button to send... the data is sent to a PHP/CGI/ASP script which takes the message and either stores it in a database or file. The page then reloads and loads any new messages that have been stored.
This way that other people you are chatting with will reload their pages (usually by an automatic mechanism every minute or so) and gets the new messages you typed to them.
I am just telling you this because I wanted you to know there is more involved than just HTML when building this. The reason it is built this way is because of how web pages work in that they don't update without being told to and the data needs to be sent out to those who are chatting with you.
I hope this makes sense.