OneStopTesting.com - Testing EBooks, Tutorials, Articles, Jobs, Training Institutes etc.
OneStopGate.com - Gate EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopMBA.com - MBA EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopIAS.com - IAS EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopSAP.com - SAP EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopGRE.com - of GRE EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
How to: Declare the variable in JavaScript | Articles | Recent Articles | News Article | Interesting Articles | Technology Articles | Articles On Education | Articles On Corporate | Company Articles | College Articles | Articles on Recession
Home » Articles » How to: Declare the variable in JavaScript
How to: Declare the variable in JavaScript
Article Posted On Date : Saturday, March 24, 2012
How to: Declare the variable in JavaScript
Advertisements
Introduction: Variables are used to store the value. Once a variable is declared, it may be accessed anywhere inside the function where it is declared. Variables declared outside any function. Variables can be declared with a var statement. Example: In this example you will learn how to declare the variables. var myname="puru"; document.write(myname); Here variable name is declared in left side of the expression and assign the value in the right side of the expression. Example: I am giving another example to understand the variable declaration. <html> <head><title>Variable declaration</title> </head> <body> <script type="text/javascript"> var name = "Charls" document.write(name) document.write("<h1>"+name+"</h1>") </script> <p><font color= olive> you are looking the value of variable as Charls.</font> </p> <p><font color= olive>The variable is displayed one more time, only this time as a heading.</font> </p> </body> </html>
Amazon.in Widgets