I am using Google Places for my location text box and its working fine. But I need to make it class based implimentation so I can use it with any other places multiple time. I don't know this class based is possible or not is there any way to do with JQuery?
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxxxxxxxx&libraries=places"></script>
<script src="assets/js/jquery.searchable-1.0.0.min.js"></script>
<script>
// scripts.js custom js file
$(document).ready(function () {
google.maps.event.addDomListener(window, 'load', initialize);
});
function initialize() {
var input = document.getElementById('location');
var input2 = document.getElementById('location2');
var autocomplete = new google.maps.places.Autocomplete(input);
var autocomplete = new google.maps.places.Autocomplete(input2);
}
</script>