I am attempting to retrieve data from a firebase database and display all of the results. I am used to using jquery's appendTo function for this task, but I am unsure how to achieve the same result with pure javascript.
Below is my current script:
<div id="resultsContainer"></div>
var fireBaseRef = new Firebase("https:somefirebaseurl.firebaseio.com/results");
fireBaseRef.once("value", function(snapshot) {
snapshot.forEach(function(childSnapshot) {
var key = childSnapshot.key();
// childData contains the actual contents of the child
var childData = childSnapshot.val();
var eName = childSnapshot.val().resultname;
console.log(eName);
resultsContainer.innerHTML += '<div class="result"></div>';
});
});
I have utilized innerHTML in the above code, but it only displays one result set, not multiple as intended.