I am trying to update the DOM with some HTML and scripts that use jQuery. The section of the DOM that is being updated is BEFORE the jQuery code is called (within the DOM), but since the jQuery is what places this code the code is placed after the jQuery is called.
Can this work? I cannot get it to right now.
Here's my HTML:
<div id="readThisData">
Some data
</div>
<div id="addScript">
No script yet
</div>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script>
$( document ).ready(function() {
$('#addScript').html(console.log($('#readThisData').html()));
}
</script>