Check out example codes for "how to use document.getelementbyid". It will help you in understanding the concepts better.

Code Example 1

<p id="YourId">How to use document.GetElementById in HTML</p>
<script>
document.GetElementById('YourId')./* The thing you need to do to your code... Here I want .innerHTML you can take any...  */.innerHTML('/* what will it change... */')
</script>

Code Example 2

var element = document.getElementById("YourElementId");

Code Example 3

document.getElementById("demo");

Code Example 4

document.getElementById("someid");

Code Example 5

var myElement=document.getElementById("someElementID");

Code Example 6

<p id="YourId">How to use document.GetElementById in HTML</p>
<script>
  function demo(){
document.GetElementById('YourId')./* The thing you need to do to your code... Here I want .innerHTML you can take any...  */.innerHTML('/* what will it change... */')
  }
</script>
<!-- Now execute it by writing the button tag!--><button onclick="demo()">Click Me!!!</button>

Learn ReactJs, React Native from akashmittal.com