In my html code I have this inline script (no src)
<script>
var div = document.createElement("div");
// insert div after this script tag
</script>
How can I then insert the div into the DOM with javascript such that it appears right after the script tag, so it ends up looking like this
<script>
var div = document.createElement("div");
// insert div
</script>
<div></div>
The main thing is I want a solution that avoids using id's, class's and attributes to try to do a lookup. Is there a way I can do something like getting the current script node and then a insertAfter method?
Thanks