OK, so I have some JS that pulls data from JSON via URL. I know Want to turn each object (author_name, rating, author_url) into js ID's so i can call the ID in html.
for example
<ul>
<li id=''></li>
<li id=''></li>
<li id=''></li>
</ul>
this is my JS code so far
<div id="map"></div>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=123-mg&libraries=places&callback=initMap"></script>
<script>
function initMap() {
var service = new google.maps.places.PlacesService(map);
service.getDetails({
placeId: '123'
}, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for(var i=0; i <= place.reviews.length; i++) {
console.log(place.reviews[i]);
alert(place.reviews[i].author_name);
alert(place.reviews[i].rating);
alert(place.reviews[i].author_url);
alert(place.reviews[i].text);
alert(place.reviews[i].relative_time_description);
alert(place.reviews[i].profile_photo_url);
}
}
});
}
</script>
what is the best way to get these into html so I can style and use around the page?