Select the first span element which is not empty
<p>From a group of span elements, I want to get the values of the first occurrence of a span that is not empty.</p>

<p>I have this HTML</p>

<pre><code>&lt;span class="map_multi_latitude"&gt;&lt;/span&gt;
&lt;span class="map_multi_longitude"&gt;&lt;/span&gt;
&lt;span class="map_multi_latitude"&gt;30.201998&lt;/span&gt;
&lt;span class="map_multi_longitude"&gt;120.990876&lt;/span&gt;
</code></pre>

<p>I have this Jquery before but I want to make it work such that "the first span whose text is not empty":</p>

<pre><code>initialLat = $('span.map_multi_latitude:first').text();
initialLng = $('span.map_multi_longitude:first').text();
</code></pre>

<p>thanks in advance!</p>
