title: how to insert javascript code via jquery?
body: <p>
      <br>
              <br>
      
      </p>
  
  <pre><code>&lt;div id="example"&gt;
  
  &lt;/div&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
    function insert() {
       var data = '&lt;script type="text/javascript"&gt;  function test() {    a = 5;   }&lt;\/script&gt;';  
       $("#example").append(data);
    } 
  
    function get() {
       var content = $("#example").html();
       alert(content);
    }
  
  
  &lt;/script&gt;
  
  
  &lt;a href="#" onclick="insert();"&gt;INSERT&lt;/a&gt;
  
  &lt;a href="#" onclick="get();"&gt;GET&lt;/a&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>what i want to do:</strong></p>
  
  <p>when i click on insert, i want to insert this code into example div:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;  function test() {    a = 5;   }&lt;\/script&gt;
  </code></pre>
  
  <p>when i click on get, i want to get that code, which i inserted there.</p>
  
  <p>but when i click on insert, and then on get, there's no code.. where is problem ? thanks</p>