title: How do i pass parameters that is input textbox value to ajax in jQuery
body: <p>My Ajax code </p>
  
  <pre><code>$(document).ready(function() {
      $("#sub").click(function() {
          $.ajax({
              type: "POST",
              url: "jqueryphp.php",
              data: "txt1=" + txt1,
              success: function(result) {
                  $("div").html(result);
              }
          });
      });
  });​
  </code></pre>
  
  <p>This is the form code . I want to pass txt1 value to Ajax</p>
  
  <pre><code>&lt;input type="text" name="txt1" id="txt1" /&gt;&lt;br&gt;
  &lt;input type="button" name="sub" id="sub" value="click Me" /&gt;
  </code></pre>
  
  <p>I want to pass <strong>txt1</strong> value to my php page using this Ajax function. </p>
  
  <p>Please tell me what exactly will come in the data attribute of Ajax</p>