+ Start a Discussion
Navneeth RajNavneeth Raj 

Why we use var name in script tag?

What is the usage of var name in script, i mean like below?

<apex:page controller="RemoteExample" id="page">
        var name;
Hi Navneeth,

var is variable in javascript. Like integer, string.

You can store any type of data in Var

eg: var name = 'Test';
var numb = 10;

More information in the above link.

Amit Chaudhary 8Amit Chaudhary 8
In var name. var is datatype and Name is valiable name according to java scipt systex.

Please check below link for more information.

for example :-

var x = 5;
var y = 6;
var z = x + y;
document.getElementById("demo").innerHTML = z;

Please let us know if this will help you,

Amit Chaudhary