title: Passing Variables in jQuery to Change a Dialog Title
body: <p>I'm trying to set up a dialog box, I want the name of the button pressed transferring into the dialog box, but I don't know how to do this.</p>
  
  <p>So far I have:</p>
  
  <pre><code>$(document).ready(function(){
  $("#x").live('click', function(){
   var name = $(this).attr('name');  //want to pass this to the next jquery
   $('#dialog_box').dialog("open");
  });
  var input = $("#input");    
  $("#dialog_box").dialog({
      autoOpen: false,
      resizable: false,
      height:180,
      width: 350,
      modal: true,
      buttons: {
          "Update": function(){
              alert(name);
          }
      }
    });
  });
  </code></pre>
  
  <p>Also, how would I go about using the variable, once transferred to update the title of the dialog box (markup below)?</p>
  
  <pre><code>&lt;div id="dialog_box" title="name variable here"&gt;
   &lt;form id="dialog_form" name="dialog_form"&gt;
    &lt;fieldset&gt;
     &lt;input type="text" name="input" id="input"/&gt;
    &lt;/fieldset&gt;
   &lt;/form&gt;                
  &lt;/div&gt;
  </code></pre>
  
  <p>Any help appreciated   :)</p>