Using Object Literals
Literals are shorter way to define objects and arrays in JavaScript.
by mrrodd
HTML
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<form name="mainform" method="post">
<input type="text" name="quotedate" value="8/1/2009"/>
<input type="text" name="quotestatus" value="Pending"/>
</form>
</body>
</html>
JavaScript
var MyQuotes = {
quoteDate: document.mainform.quotedate.value,
quoteStatus: document.mainform.quotestatus.value,
Filter: function() {
alert("Filter the tab");
},
Reset: function() {
alert("Reset the tab");
}
};
MyQuotes.Filter();
alert( MyQuotes.quoteDate );