Create an array of objects from fields on a page
<p>I have a page that displays hotel data in a list. I have this data on the page:</p>

<pre><code>&lt;input type="hidden" class="name" value="Hotel1" /&gt;
&lt;input type="hidden" class="latitude" value="-12.3456" /&gt;
&lt;input type="hidden" class="longitude" value="12.3456" /&gt;

&lt;input type="hidden" class="name" value="Hotel2" /&gt;
&lt;input type="hidden" class="latitude" value="98.7654" /&gt;
&lt;input type="hidden" class="longitude" value="-98.7654" /&gt;
</code></pre>

<p>I'd like to create an array of objects from those values, so that I can loop through each hotel and do something like this:</p>

<pre><code>$.each(hotels, function (index, obj) {
    var name = obj.name;
    var lat = obj.latitude;
    var long = obj.longitude;
});
</code></pre>
