title: pass the value of a text to a jquery function
body: <p>How can I pass the value of a text to a jquery function, when I click on that text?</p>
  
  <pre><code>$.each(docs2, function(i, item) {
  $('#body).append($('&lt;div class="mytext"&gt;' + item.text+'&lt;/div&gt;'));
    });
  
  
  function on_text() {
  var query = $('#text_box').val();
  
          if (query.length == 0) {
              return;
          }
     }
  </code></pre>