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

Code Example 1

There is no actual way to put javascript inside an HTML attribute
But there are some event attribute that can trigger JavaScript 
Otherwise you have to use <script> tag or external JavaScript

Code Example 2

  //Insert JS scripts here
  var html
  html = "You can use the <script> tag to incorporate JS code into your HTML code"

Code Example 3

	//JavaScript here

Code Example 4

  // Write JS here

<script src="link/to/js/file.js"></script>

Learn ReactJs, React Native from