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

Code Example 1

a:active  {     background-color: yellow;  }

Code Example 2

:active {
  css declarations;
}

Code Example 3

something:active {}

Code Example 4

CSS clicked event
:active {
  css declarations;
}

Code Example 5

P Example
Click on a <p> element to change its text color to red:

 <p id="demo" onclick="myFunction()">Click me to change my text color.</p>

 
<script>
function myFunction() {
    document.getElementById("demo").style.color = "red";
}
</script>

Learn ReactJs, React Native from akashmittal.com