Check out example codes for "inner html templates". It will help you in understanding the concepts better.

Code Example 1

function log(msg) {
  var logElem = document.querySelector(".log");
 
  var time = new Date();
  var timeStr = time.toLocaleTimeString();
  logElem.innerHTML += timeStr + ": " + msg + "<br/>";
}

log("Logging mouse events inside this container...");

Learn ReactJs, React Native from akashmittal.com