No special keyword will be required to define variable as Global. Variables declared globally have a global scope, they known throughout the application, from the start of the application.
<!DOCTYPE html>
<html>
<body>
<div id="test"></div>
<script>
//global variable
var a = 100;
globalFunc();
function globalFunc(){
document.getElementById("test").innerHTML = a;
}
</script>
</body>
</html>
Most Helpful This Week
Image Rollover Using onMouseOver and onMouseOut
jQuery Show or Hide text on button click
JavaScript check if first string contains all characters of second string
Using jQuery add new table row on click
How to get selected text from a select box using jQuery?
Example to take user input and display on screen using JavaScript