Latest news
Home » Google » How to get a click event inside of google maps infowindow

How to get a click event inside of google maps infowindow

Jquery events foroogle maps infowindow elements are not work inside $(document).ready(function(){}) or script> tag because the elements not added to the dom when browser execute the jQuery.

Solution for this problem is need to add one click listener for google maps infowindow.

google.maps.event.addListener(infowindow, 'domready', function(e){
//Put your jQuery code here
});

//example of infowindow jquery click

google.maps.event.addListener(infowindow, 'domready', function(){
$('#btn-test').click(function(e) {
e.preventDefault();
alert('smart click');
});
});

Leave a Reply

x

Check Also

Animated Scroll to Top

Jquery code for Animated Scroll to Top

Create a div with class name gotop and Simply Copy paste the jquery code in ...