Using variables in multiple function
<p>In this example:</p>

<p>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.</p>

<p>Does anyone know how i could do it?</p>

<pre><code>jQuery("td.setting").live("click",function(){
   text = jQuery(this).text();
   var id = jQuery(this).attr("id");

   jQuery(this).replaceWith("&lt;td class=\"update\"&gt;&lt;input class='inputSetting' type='text' value="+text+"&gt;  &lt;img class=\"accept\" alt=\"accept button\" src='images/accept.png'&gt;&lt;/td&gt;");
   console.log(id);
 });
 jQuery("img.accept").live("click",function(){

   jQuery("td.update").replaceWith("&lt;td class=\"setting\"&gt;&lt;proc name='C_Settings::getSavedSetting' params='"+id+"'&gt;&lt;/proc&gt;&lt;/td&gt;");
    });
</code></pre>
