<div id="test"></div> <script> test.innerHTML = '<script>alert("Yes")<\/script>'; var scr = document.querySelector('script'); eval(scr.text); </script>