onnstate').innerHTML = 'CLOSED';
        }
        ws.onmessage = function (e) {
          var p = document.createElement('pre');
          p.appendChild(document.createTextNode(e.data));
          $('msgs').appendChild(p);
        }
    }
    $('sendForm').onsubmit = function (event) {
      var p = $('phrase');
      ws.send(p.value);
      p.value='';
      return false;
    }
    $('btnConn').onclick = function(event) {
      go(); return false;
    };
  </script>
  </body>
</html>

