codice:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>chat</title>
<script type="text/javascript">
function mexchat () {
  document.getElementById("mex").innerHTML = document.getElementById("testo").value ? "Sta scrivendo&amp;hellip;" : "";
}
</script>


</head>

<body>
  <div id="chat">
    <form method="post" action="#" id="formchat">
      <table border="1px">
        <tr>
          <td id="mex" colspan="2"></td>
        </tr>
          <tr><td><input type="text" id="testo" onkeypress="mexchat();" onchange="mexchat();" /></td>
          <td><input type="submit" value="invia"/></td>
        </tr>
      </table>
    </form>
  </div> 
</body>

</html>