JSFiddle - React, Tailwind, and code Playground

by Trey Hunner

HTML

<input type="button" id="button" value="Set x">
<input type="button" id="check-x" value="Check x">
<a href="http://www.stackoverflow.com">Click Me</a>

JavaScript

var x = 0; //this occurs in the beginning of the page.

$("#button").click(function(){
    x = 1;
});

$("#check-x").click(function(){
   alert(x); 
});