Mixed message

I am doing Mix message project, I made this project in JavaScript but my coding is not running properly, please anyone can let me know what should i need to do.