[an error occurred while processing this directive]
When you need to DO something, like open a window, write text to the screen, get the sin of a number, isolate the 1st letter in a word, assign today's date to a variable, send the user back to the previous page, or display an alert box you are using a method.
When you change the details about something which already exists, you are changing its properties.
For example:
document.bgcolor="red" is a property because I'm changing the existing details about the document.
alert("Hello There") is a method because it creates something new, an alert box.
Here are a few types of commands that methods are useful for.
Let's Learn Methods |