how to make a web-based chat which sends html instead of only text
===

I'm working on a project which needs a web-based real-time chat where participants communicate with each other by sending any type of media in a form of html. 

Basically, instead of chatting by sending only text between people in a room and attach the text to the chat room webpage, i need a code to let users send photos, video, text .. etc in a complete html web page.

Please note that I don't mean to attach (add) the media (i.e. photos/videos) in the chat webpage. What I mean is a way to make the server sends everytime a new & complete html webpage to everyone in that particular room.

I hope it's clear for everyone.

Thank you very much!