Jquery .children(); reset
<p>Im using .children(); to count a number of results pulling from a search query, but when I get a search that doesn't bring back results it still has the same count from the previous search. Is there anyway to clear it to ready it for the next search?
Here is the code im using:</p>

<pre><code>function results(){
var n = $("#sidebar").children().length;
$(".numresults").html("Found &lt;span class='bright'&gt;" + n + "&lt;/span&gt; results in your area.");
}
</code></pre>

<p>This is the search function results() is in:</p>

<pre><code>   function searchLocationsNear(center) {
   var radius = document.getElementById('radiusSelect').value;
   var searchUrl = 'genxml.php?lat=' + center.lat() + '&amp;lng=' + center.lng() + '&amp;radius=' + radius;
GDownloadUrl(searchUrl, function(data) {
   var xml = GXml.parse(data);
 var markers = xml.documentElement.getElementsByTagName('marker');
 map.clearOverlays();
 var sidebar = document.getElementById('sidebar');
 sidebar.innerHTML = '';
 if (markers.length == 0) {
   sidebar.innerHTML = '&lt;p class="caption"&gt;No results found.&lt;/p&gt;';
   map.setCenter(new GLatLng(40, -100), 4);
   return;
 }

 var bounds = new GLatLngBounds();
 for (var i = 0; i &lt; markers.length; i++) {
   var name = markers[i].getAttribute('name');
   var address = markers[i].getAttribute('address');
   var type = markers[i].getAttribute('type');
   var phone = markers[i].getAttribute('phone');
   var city = markers[i].getAttribute('city');
   var state = markers[i].getAttribute('state');
   var zip = markers[i].getAttribute('zip');
   var distance = parseFloat(markers[i].getAttribute('distance'));
   var point = new GLatLng(parseFloat(markers[i].getAttribute('lat')),
                           parseFloat(markers[i].getAttribute('lng')));

   var marker = createMarker(point, name, address, type, phone, city, state, zip);
   map.addOverlay(marker);
   var sidebarEntry = createSidebarEntry(marker, name, address, distance, type, city, state, zip);
   sidebar.appendChild(sidebarEntry);
   bounds.extend(point);
 }
 paginate();
 results();
 offon();
 map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
});
}
</code></pre>
