javascript error { [native code] }

The getMonth and the rest are functions, not properties, when you call just today.getMonth you are getting a reference to the actual function. But, if you execute it using parenthesis, you get the actual result.

Your code should be:

document.write(today.getMonth()  + "<br />");
document.write(today.getMonth()  + "<br />");
document.write(today.getFullYear()  + "<br />");

You are missing the parenthesis().

document.write(today.getMonth()  + "<br />");
document.write(today.getMonth()  + "<br />");
document.write(today.getFullYear()  + "<br />");

Tags:

Javascript