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
jQuery Show or Hide text on button click
How to join string with number in JavaScript?
Image Rollover Using onMouseOver and onMouseOut
Write a function that splits an array into groups the length of size and returns them as a two-dimensional array
How to show hide option list items using jQuery?
Using jQuery delete table row on click