title: Using substring with text() to remove html tags?
body: <p>I'm using jQueryUI autocomplete to pull results from a SQL database. I use the <code>substring</code> method to limit results' descriptions to 350 characters. But it seems that I can't use <code>.text()</code> alongside with substring to remove all the html tags from the descriptions. When I type in a search term, the console returns </p>
  
  <p><code>TypeError: item.description.text is not a function</code> </p>
  
  <p>Can someone tell me what should be used to remove html tags from descriptions? </p>
  
  <pre><code>$(function() {
  
    $( "#Search" ).autocomplete({
      source: function( request, response ) {
        $.ajax({
          url: "get.php",
          dataType:"json",
          data:{q:request.term},
          success: function( data ) {
  
            response($.map( data.products, function( item ) { return { 
  
             label:item.name,
             category:item.category,
             description:item.description.text().substring(0,350).split(" ").slice(0, -1).join(" ") 
                                       //.text() doesn't work.
  }
  </code></pre>
  
  <p>Assigning the Data: </p>
  
  <pre><code> }).data("ui-autocomplete")._renderItem = function(ul, item) {
  
     var inner_html = '..........&lt;p&gt;'+ item.description +'...&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;';
  </code></pre>