JQuery - "Selector" for current position in document
<p>is there a selector or function in JQuery that allows to select the "current position in the document"?</p>

<p>For Example if i use <code>&lt;script&gt;document.write("test");&lt;/script&gt;</code> the output will be placed in the HTML document at the "position" where this "code" stands. But JQuery always requires a special selector. Of course I could be using a "marker div" with a unique selector, but is it also possible to insert HTML with JQuery right at the place where where the JQuery expression stands?</p>

<p>I tried. <code>&lt;script&gt;$(this).after("test");&lt;/script&gt;</code> but this ist not working. Help would be very much appreciated how this can be solved. Thank you!</p>

<p>EDIT:
Regarding the question below: The Idea is not to directly print out something with document.writeln (it was more meant as an example) but to determine the current "position" in the document with JQeury (and than starting from that position on with "navigation/traversal" of elements by using the JQuery functionality. </p>

<p>Maybe this can be called a "relative traversal of elements starting from the current position on in the DOM Tree"?</p>

<pre><code>&lt;div&gt;Position1&lt;/div&gt;
&lt;div&gt;Position2&lt;/div&gt;
&lt;script&gt; HOW TO GET THIS POSITION WITH JQUERY (SEE NOTES BELOW) TO FURTHER NAVIGATE FROM HERE ON (RELATIVELY) TO THE PREVIOUS OR NEXT ELEMENT&lt;/script&gt;
&lt;div&gt;Position3&lt;/div&gt;
&lt;div&gt;Position4&lt;/div&gt;
</code></pre>

<p>NOTES: The script tag with the jquey statements will be inserted dynamically in the document and what I am interested in is, to be able to navigate from this position on in the document with JQuery. In the script Tag I might call sth  like "WRAP THE NEXT HTML ELEMENT WITH A TAG VIA JQUERY" or "GIVE ME THE NEXT HTML ELEMENTS VALUE-ATTRIBUTE". As stated above it is possible to insert a "marker div" to determine the position but the question is, if JQuery is "autonomically" able to determine it's position in the DOM-Tree (to start navigation in a "relative manner" from there on). </p>
