Add element before after its called
<p>I had one php script in which I am calling one function.</p>

<p>Example SCRIPT:</p>

<pre><code>    &lt;div class="main-info"&gt;
        &lt;div class="screenshot"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="screenshot-later"&gt;
    &lt;/div&gt;    
</code></pre>

<p>I want to display </p>

<pre><code>&lt;div class="screenshot-later"&gt;&lt;/div&gt; 
</code></pre>

<p>this div in main-info class where div is </p>

<pre><code>&lt;div class="screenshot"&gt;
</code></pre>

<p>I just have rough idea that it can be done using javascript or jQuery.</p>

<p>But didn't know much about it so any help will be much appreciated.</p>