Sunday, 15 July 2012
Create a direct instance of an object using javascript
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
personObj={firstname:"peter",lastname:"park",age:20,eyecolor:"black"}
document.write(personObj.firstname + " is " + personObj.age + " years old.");
</script>
</body>
</html>
The result is:
Peter is 20 years old.
This post was written by: Bharathi
Bharthi is a professional blogger, web designer and front end web developer. Follow him on Twitter
Subscribe to:
Post Comments (Atom)
0 Responses to “Create a direct instance of an object using javascript”
Post a Comment