title: Trying to dynamically create a modal and execute custom script fails
body: <p>Firstly, When i append my Data and Code into the wrapper, it doesnt show the code which is very peculiar. when i quick watch this with Visual Studios.  Then finally it wont show the modal at all.</p>
  
  <p>Code: </p>
  
  <pre><code>var wrapper = $("&lt;div&gt;");
  var data = $("&lt;select&gt;");
  data.append('&lt;option value = "17"&gt;Asset Name Read Only&lt;/option&gt;').append('&lt;option value = "18"&gt;Asset Type&lt;/option&gt;').append('&lt;option value = "19"&gt;Asset Code Read Only&lt;/option&gt;').append('&lt;option value = "20"&gt;Asset Parent&lt;/option&gt;').append('&lt;option value = "21"&gt;Asset Parent All&lt;/option&gt;').append('&lt;option value = "22"&gt;Asset Name Editable&lt;/option&gt;').append('&lt;option value = "23"&gt;Asset Code Editable&lt;/option&gt;')
  var code = $("&lt;script&gt;").attr("type", "text/javascript").html('$(".modal select option").click(function(){$(SELECTED_ELEMENT).attr("elType", $(this).val());});');
  wrapper.append(data).append(code);
  parent.showOverlay();
  parent.showModal(wrapper);
  </code></pre>
  
  <p>the above statement "parent.showModal(wrapper)" is as follows:</p>
  
  <pre><code>function showModal(data){
    $("&lt;div class = 'modal'&gt;").css({
        top: $(window).height() / 2 - $("div.modal").height() / 2,
        left: $(window).width() / 2 - $("div.modal").width() / 2
    }).append(data).fadeIn();
  }
  </code></pre>
  
  <p>Im not quite sure what is going on in the sense that neither the modal is showing nor why the javascript is being appended to the wrapper div.  What am i doing wrong?</p>