title: jQuery save local variable for use later on in the code
body: <p>Is there anyway that I can save or access a local variable outside of it's function? Consider the code below:</p>
  
  <pre><code>$( "#droppable2" ).droppable({
          activeClass: "ui-state-hover",
          hoverClass: "ui-state-active",
          accept: "#draggable3",
          drop: function( event, ui ) {
  
              jdc = $(this).attr("id"); //I need to use this value later
              $( this )
                  .addClass( "ui-state-highlight" );
                  var x = ui.helper.clone();   
                  x.appendTo('body');
  
                  var jdi = $("img").attr("id");// I need to use this value later
  
                  $(this).droppable( 'disable' );
          }
      });
  </code></pre>
  
  <p>Is there anyway to get the values of the two variables (jdc and jdi above) for later use outside of the function?</p>
  
  <p>The ultimate goal is to get id of droppable container and content of dropped element.</p>