</h1> <h2>Status: <code id="statusField">NO-STATUS</code></h2> <div>Set a server URL, then push "Connect" button to establish a connection. <br>"Send" button sends text message on the left text area. <br>"Close" button closes the connection. <div> <form action="#" onsubmit="doConnect(); return false;"> <input type="text" id="url" style="width: 400px" value="ws://html5rocks.websocket.org/echo?encoding=text"> <input type="submit" value="Connect"> </form> <form action="#" onsubmit="doSend(); return false;"> <input type="text" id="message" value="hello" style="width: 400px"> <input type="submit" value="Send"> </form> <input type="button" value="Close" onclick="doClose()"> <div id="listener"></div> <div id="log"></div> </body> </html>