Check out example codes for "css getelementbyid". It will help you in understanding the concepts better.

Code Example 1

document.getElementById("demo");

Code Example 2

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

Code Example 3

var x = document.getElementById("demo");   // Get the element with id="demo"
x.style.color = "red";                     // Change the color of the element

Learn ReactJs, React Native from akashmittal.com