function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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">
    <script>
        var name;
    </script>
</apex:page>
 
SaranSaran
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;
http://www.w3schools.com/js/js_variables.asp

More information in the above link.

Thanks.
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.
http://www.w3schools.com/js/js_variables.asp

for example :-

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


Please let us know if this will help you,

Thanks,
Amit Chaudhary