In this example:
I would like to use the "id" which is defined in the second function in the last (second) function. I thought using the "var" term would suffice but it doesn't.
Does anyone know how i could do it?
jQuery("td.setting").live("click",function(){
text = jQuery(this).text();
var id = jQuery(this).attr("id");
jQuery(this).replaceWith("<td class=\"update\"><input class='inputSetting' type='text' value="+text+"> <img class=\"accept\" alt=\"accept button\" src='images/accept.png'></td>");
console.log(id);
});
jQuery("img.accept").live("click",function(){
jQuery("td.update").replaceWith("<td class=\"setting\"><proc name='C_Settings::getSavedSetting' params='"+id+"'></proc></td>");
});