Check out example codes for "html script id and class". It will help you in understanding the concepts better.

Code Example 1

<!--
	The script tag's id and class property work just like in any html tag.
	Possible use case is to add css styles to your script tag.

	Using e.g. 'class="createFunctionality" type="text/javascript"' in a
	script is a good practice if you use a editor,
	that displays the name of the script when collapsed,
	as part of documentation; e.g. Indicate what the script does.
	
	You can also view the source code of the script like this:
-->

<!-- Rememer to add jquery! -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<script class="foo" type="text/javascript">
	function foobar() {
	    var a = 1;
	}   
</script>

<div id="showScript">Show me the script.</div>

<script type="text/javascript">
    $('#showScript').click(function(event) {
        event.preventDefault();
        $("<div>").html($(".foo").text()).appendTo($("body"));
    });
</script>

Code Example 2

<style>
#grepperHeader {
  background-color: lightblue;
  color: navy;
  padding: 40px;
  text-align: center;
}
</style>

<h1 id="grepperHeader">grepperHeader</h1>

Code Example 3

<style>
  #test {
  /*Styleing here*/
  }
</style>
<h1 id="test"></h1>

Learn ReactJs, React Native from akashmittal.com