I don't believe that your index.html can access the dom of your site. I think you have to do what you did with the Join message, and send a response back to the client. I don't have a lot of experience with jquery, so I cant help any more than that, sorry.
pog @FeixuRuins