If you have three buttons on a page, you can determine which button was clicked by checking the button's ID or name. The property above was set by directly accessing the ID attribute. Some properties have properties, too. Methods A method is a piece of code that an object calls to do something. In OOP, an object calls a method in response to some message that is sent to the object, in order to perform some task.
Messages are the mechanism that is used in order for objects to communicate with each other.
Microsoft's Windows operating systems rely heavily on this mechanism, sending messages to objects in order to notify the object that an event has occurred or that something should be done. You refer to the object by name and then to the method, and separate them by periods, and you include the extra data enclosed by parentheses. The window has a status bar, toolbar, and a menu bar, and it is 100 pixels high by 200 pixels wide. Procedures, Functions, and Subroutines A procedure is a piece of distinct code that performs some task. It is different from a method in that it is unrelated to objects.