I have a jquery code that gets json data and list them in a ul list. I want to populate this Items on click.
$('#places)
is a ul list.
$.each(data, function (id, item) {
$('#places').append('<a href="#" class="list-group-item" data-lat=' + item.lat + ' data-lng=' + item.lng + '>' + item.name + '</a>');
});
Ul list items are links that included latitude and longitute values. I want to add click event to that links. Which I click link zoom to that location. How can add event?