Check if position exists
<p>I have a page with elements, with relative position. </p>

<pre><code>style="position: relative;"
</code></pre>

<p>Some have top/left coordinates and some don't. Is there a way to check of the coordinates exist inside the style tag with jQuery?</p>

<p>If not, I'd like to add them by doing something like:</p>

<pre><code>if (...) {
    var myDiv = $(".myDiv");    
    var pos = myDiv.position();
    myDiv.css({ "left:" + pos.left + "px", "top:" + pos.top + "px" });
}
</code></pre>
