title: jQuery val is undefined?
body: <p>I have this code:</p>
  
  <pre><code>&lt;input type="hidden" id="editorTitle" name="title" value="home"&gt;
  &lt;textarea name="text" id="editorText"&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p>But when i write <code>$('#editorTitle').val()</code> and <code>$('#editorText').html()</code>, <code>$('#editorTitle').val()</code> is 'undefined' and <code>$('#editorText').html()</code> is empty?</p>
  
  <p>What is wrong?</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <p>Here is my full code:</p>
  
  <pre><code>function openEditor() {
      $("#editor").show().animate({ width: 965, height: 380 }, 1500);
      $("#editor textarea").show();
  }
  
  function closeEditor() {
      $("#editor").animate({ width: 985, height: 1 }, 1500, function () {
          $("#editor").hide();
          $("#editor textarea").hide();
      });
  }
  
  function setedit() {
      $.ajax({
          type: "POST",
          url: "engine.php",
          data: "title=" + $('#editorTitle').attr('value') + "&amp;text=" + $('#editorText').html(),
          beforeSend: function () {
              $('#mainField').html('&lt;img src="data/images/loader.gif" alt="Loading..."&gt;');
          },
          success: function (msg) {
              alert(msg);
              closeEditor();
              search();
          }
      });
  }
  function search() {
      $('#title').val($('#search').val());
  
      $.get('engine.php?search=' + $('#search').val(), function (data) {
          $('#mainField').html(data);
      });
  
      $.get('engine.php?raw=true&amp;search=' + $('#search').val(), function (data2) {
          $('#editorText').html(data2);
      });
  
      $.get('engine.php?title=true&amp;search=' + $('#search').val(), function (data2) {
          $('#h1').html(data2); // Row 152
          $('#editorTitle').html(data2);
      });
  }
  
  $(document).ready(function () {
      $("#ready").html('Document ready at ' + event.timeStamp);
  });
  </code></pre>
  
  <p>But what is wrong?!?!</p>