title: jquery: passing parameter to modal
body: <p>I have the following  in a table, repeated for each row:</p>
  
  <pre><code>&lt;a &lt;?php echo 'id="'.$id.'"'; ?&gt; class="custom-dialog-btn btn btn-small"&gt;
     &lt;i class="icon-trash"&gt;&lt;/i&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>where <code>id</code> is different for each line, because it is taken from a table in database where it is the primary key.</p>
  
  <p>Then, I used th following jQuery code:</p>
  
  <pre><code>$(".custom-dialog-btn").bind("click", function (event) {
                  $("#mws-jui-dialog").dialog("option", {
                      modal: false
                  }).dialog("open");
                  event.preventDefault();
              });
  
        $("#mws-jui-dialog").dialog({
          autoOpen: false,
          title: "Alert",
          modal: true,
          width: "640",
          buttons: [{
              text: "NO",
          id: "cancel_button",
              click: function () {
                  $(this).dialog("close");
              }
          },
       {
          text: "OK",
          id: "confirm_button",
              click: function () {
                  myremovefuntion(id); // I need the id
          }}
      ]
      });
  </code></pre>
  
  <p>that refers to the dialog:</p>
  
  <pre><code>&lt;div id="mws-jui-dialog"&gt;
      &lt;div class="mws-dialog-inner"&gt;
      &lt;h2&gt;Are you sure you want to delete?&lt;/h2&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I pass the id to the modal? </p>