title: content.match is not a function
body: <p>I am trying to make a autocomplete system using jquery but i get the following error from firefox developer console.</p>
  
  <pre><code>content.match is not a function
  </code></pre>
  
  <p>What i am missing here anyone can help me please ?</p>
  
  <p>Here is my Jquery code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function(){
     var timer = null;
     var tagstart = /@/gi;
     var tagword = /@(\w+)/gi;
     $("body").delegate(".addpost", "keyup", function() {
      
      clearTimeout(timer);
      timer = setTimeout(function() {
        var contents = $(this).text(); 
        var goWord = content.match(tagstart);
        var goname = content.match(tagword);
       var ID = $(this).attr("id");
     if (goWord.length &gt; 0) {
        var appendAfterHere = $(".tag_"+ID).after('&lt;div class="mentions"&gt;&lt;/div&gt;');
        if (goname.length &gt; 0) {
           
     }
     }
             
      }, 500);
    });
    });
  
   </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="container"&gt;
    &lt;div class="postit tag_1"&gt;
      &lt;textarea name="" id="1" cols="30" rows="10" class="addpost" placeholder="Start to type with @mention"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong><a href="https://codepen.io/shadowman86/pen/BvRzmw" rel="nofollow noreferrer">HERE</a></strong> is a codepen demo page also.</p>