title: Greasemonkey timer and replace
body: <p>The timer should check and replace a text every 1 sec on Facebook chat submit message box</p>
  
  <pre><code>function gopi()
  {
      chatDiv=document.getElementsByClassName('fbNubFlyoutFooter')[0].getElementsByClassName('inputContainer')[0].getElementsByClassName('uiTextareaAutogrow input')[0];
  
      for(x in chatDiv)
      {
          //var str=chatDiv[x].innerHTML;
          //str.replace("message2replace", "replacedmessage");
          if(chatDiv[x].innerHTML=="message2replace")
          {
              chatDiv[x].innerHTML="replacedmessage";
          }
      }
  
      setTimeout(gopi,5000);
      }
  
  setTimeout(gopi,2000);
  
  void 0;
  </code></pre>
  
  <p>Edit: If this is not able, then how can I make a box that replaces the text and send it?</p>