Check out example codes for "online html editor". It will help you in understanding the concepts better.
Code Example 1
#I recommmend https://codepen.io/pen/
Code Example 2
<!-- Answer to: "online html editor" --> <!-- A common good "online editor" would be: https://jsfiddle.net/ However, for an online editor focusing specifically on html this one is pretty good: https://html-online.com/editor/ -->
Learn ReactJs, React Native from akashmittal.com