I am using a store locator jquery plugin from http://www.bjornblog.com/web/jquery-store-locator-plugin for my website and everything works fine but what I want to add is once the store location list is generated, the first one on the list is automatically clicked.
In the Jquery, I can see there is a section controlling the click on the list. It has some parameters.
// Handle clicks from the list
$(document).on('click.'+pluginName, '.' + _this.settings.locationList + ' li', function () {
//do the work.
}
The pluginName is 'storelocator' and _this.settings.locationList is 'bh-sl-loc-list'
the elements of the list shown on the html
<div class="bh-sl-loc-list">
<ul class="list list-unstyled"></ul>
<li></li>
<li></li>
<li></li>
</div>
I tried the belows but obviously nothing worked, what sort of syntax I should use to maybe pass the parameters and call it? Much appreciated.
document.getElementById(".bh-sl-loc-list:first-child").onclick();
$('.bh-sl-loc-list:first-child').trigger('click');