title: Get content of span
body: <p>how can I get the contents of span ?
  I'm looking for a way for all of this to be vanilla, not jQuery</p>
  
  <p>javascript (and a little jQuery)</p>
  
  <pre><code>var swear_words_arr=new Array("bad","evil","freak");
  var regex = new RegExp('\\b(' + swear_words_arr.join('|') + ')\\b', 'i' );
  
  function validate_user_text() {
  var text = document.getElementById('myInput');
  text.text();
  
  if(regex.test(text)) {
      window.location="http://www.newlocation.com";
      return false;
  }
  
  }
  var myVar=setInterval(function(){validate_user_text()},1000);change
  </code></pre>
  
  <p>here's my html</p>
  
  <pre><code>&lt;div id="textArea"&gt;
  &lt;span id="myInput" contenteditable="true"&gt;kfjdkfj&lt;/span&gt;
  &lt;/div&gt;
  &lt;br /&gt;
   &lt;form name="form1" method="post" action=""&gt;
  
  &lt;textarea rows="3" cols="40" name="user_text" style="border:2 solid #808080; font-family:verdana,arial,helvetica; font-weight:normal; font-size:10pt" onclick="select_area()"&gt;&lt;/textarea&gt;
  &lt;br /&gt;
  &lt;input type="button" value="Submit" onclick="return validate_user_text();"&gt;&lt;/form&gt;
  </code></pre>
  
  <p>Thank You</p>