title: Reinitialize global variables without refreshing the page in javascript
body: <p>Mine is a web Application, In a jsp page I have a div(outerDiv), inside which many inner Divs are added by dragging and dropping contents and a set of global variables are initialised !</p>
  
  <p>I have the following requirement.
    I have a button click, as like refreshing the whole page I need to clear and reset all the contents of the outerDiv, i.e., clear the inner Div and reinitialize all the global variables present in js file without refreshing the page.</p>
  
  <p>I found jquery <strong><em>.empty</em></strong>  the outerDiv, By calling <code>$("#attrList1").empty();</code> </p>
  
  <p>But If I again drag and drop any content inside outerDiv, it cannot be added as the div is removed. </p>
  
  <p>How do I do this ? How to reset the global variables in a javascript file?</p>
  
  <p>Any suggestions ! </p>