If you use something like:
var contents = document.getElementById('foobar').innerHTML;
and #foobar
contains <script>
tags, are the <script>
tags included?
EDIT: They are. Proof: http://jsfiddle.net/trusktr/YBzTB/
Yes it does:
JSFiddle Demo
<div id='foobar'><script type='text/javascript'>alert('kewl');</script></div>
var contents = document.getElementById('foobar').innerHTML;
console.log(contents);
Outputs:
<script type="text/javascript">alert('kewl');</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With