title: jquery How to get string from the search box
body: <p>I am studying jquery searching box.</p>
  
  <p>I am getting trouble with getting string var from html.</p>
  
  <p>in my html file. </p>
  
  <p>i have..</p>
  
  <pre><code>&lt;header&gt;
    &lt;div id="searchBox"&gt;
      &lt;form name="searchForm"&gt;
        &lt;div&gt;
          &lt;i class="icon-search icon-large icon-height"&gt;&lt;/i&gt;
          &lt;input name="searchfield" type="search" size="20" maxlength="30"&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p>and </p>
  
  <p>in my jquery file i have</p>
  
  <pre><code>$(".icon-search").click(function() {
    var searchstring  = $(this).text('#searchfield');// $('#searchfield');
    searchstring.focus();
    //$('#searchBox').html($('input:searchfield').val());
    alert("searchfield.  " + searchstring +  " hahah");
  });
  </code></pre>
  
  <p>when I clicked to searching some strings.</p>
  
  <p>It shows that Object object instead of some strings.</p>
  
  <p>I am not really sure how to convert object to strings.</p>
  
  <p>Does anybody know how to convert it ?</p>