pass value across jquery

pass value across jquery

Dear All

 I am displaying list of records 
  1. <?php  $i=0;
  2.   do { $i++;
  3. if ($i==2) { $i=0; $bgclr="#c2c2c"; } else  {$bgclr="#ffffff";}
  4. ?> 
  5.     <tr bgcolor="<?php echo $bgclr;?>">
  6.   <td> <table width="100%" border="0" cellspacing="1" cellpadding="0">
  7.   <tr  class="textselected"  id=<?php echo $rows['id'];?>>
  8.     <td width="75%"><?php echo $rows['name'];?><span class="whitelabel">
  9.       <input type="text" class="entryid" value="<?php echo $rows['id'];?>" />
  10.     </span></td>
  11.     <td class="close" style="cursor:pointer">Del<?php echo $rows['id'];?></td>
  12.   </tr>
  13. </table>
  14.  </td> </tr>
  15. <?php } while ($rows = mysql_fetch_assoc($Result)); ?>    
My JQUERY


  1. $(".textselected").click(function () {
  2.  var thisid=  this.id ; //I want to delete record of this ID .. but could not pass on or get it when 'yesdelete' is clicked
  3.  $('#askfordelete').show(); // displaying div to ask whether to delete or not ..this div is listed below
  4.   });  
  5.   
  6. $("#yesdelete").click(function () {
  7. // alert("text cliecked for delete");
  8.  
  9.   // how to get variable thisid here ?  
  10.   $('#askfordelete').hide();
  11.   $('#loadimage').show();
  12.   var url = "delheaderrefresh.php"
  13.   var data = { 
  14.      recordid: $('#recordid').val(),
  15. id:this.id
  16.   };
  17.    $('#selectheaderdiv').load(url, data,refreshdata, hideloading );
  18.    
  19.  });
  20.       
  21. $("#nodelete").click(function () {
  22.    $('#askfordelete').hide();
  23.   });     
  24. function hideloading() {
  25. $('#loadimage').hide();
  26. $('#keyword').val('');
  27. }

the div to ask whether to delete this record or not

  1. <div   id="askfordelete" style="display:none; background-color:#006699; position:absolute; width:226px; height:102px; left: 66px; top: 121px; z-index:10000;">
  2.   <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
  3.     <tr>
  4.       <td height="40" bgcolor="#E1F0F0"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  5.         <tr>
  6.           <td height="50" colspan="5" align="center" bgcolor="#990000"><span class="SLOGAN">Delete this Record </span></td>
  7.         </tr>
  8.         <tr>
  9.           <td height="18" colspan="5" align="center"  >&nbsp;</td>
  10.           </tr>
  11.         <tr>
  12.           <td width="9%" align="center"  >&nbsp;</td>
  13.           <td width="33%" height="47" align="center" class="a_demo_two" id="yesdelete">Yes</td>
  14.           <td width="15%" align="center"  >&nbsp;</td>
  15.           <td width="35%" align="center" class="a_demo_two" id="nodelete"> No</td>
  16.           <td width="8%" align="center"  >&nbsp;</td>
  17.         </tr>
  18.         <tr>
  19.           <td height="10" colspan="5" align="center"  >&nbsp;</td>
  20.         </tr>
  21.       </table></td>
  22.     </tr>
  23.   </table>
  24. </div>
Please help