Find DOM position of <script> section
Is it possible to "self-determine" the position of a script to add an element to the DOM at that position? I mean, for example in code like this
<div> <p> ... </p> <script> // my code is here </script> <a> ... </a> ... </div>
I want to add an element at the position where the script is written (son of div and after p), assuming that no element has a specific id. Is it possible?
source to share