C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Declaring Variables in JavaScript


Posted Date: 23 Jun 2008    Resource Type: Code Snippets    Category: Javascript

Posted By: Kapil Dhawan       Member Level: Gold
Rating:     Points: 2



The code sample shows how to declare variables in a javascript script. This is in fact a html file that contains javascript code.


<html>
<head>
<title>Declaring Variables in JavaScript</title>
<script language="javascript">
var myName; //variable myName is declared
myName="Kapil"; // myName is assigned a value. also called definition
document.write(myName);
document.write("<br />");
myName="Dhawan"; // assign a new value to myName. the older value is erased.
document.write(myName);
</script&RT;
</head>
<body>
</body>
</html>



The results of this example could easily be seen by copying the code into notepad, saving it as a file with .html extension and opening it in a web browser.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Using variables in javascript  .  Defining variables in javascript  .  Declaring variables in javascript  .  Declaring variables  .  Declaring and defining variables  .  Decalring and defining variables in javascript  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Using Regular Expression in JavaScript
Previous Resource: Call a Javascript Funtion on a Click Event
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

internet fax

Contact Us    Privacy Policy    Terms Of Use