References > " . "Element Reference"; $pagetitle="Method"; $customsidebar = "elemref-xbl-sidebar.php"; include "header.php"; ?>
For example, an element that allows text to be selected might have getSelected and setSelected methods.
The example below is a method toUpper that, when called, will make the value attribute uppercase.
More information about method
<method name="toUpper"> <body> var v = this.getAttribute("value"); if (v != null) this.setAttribute("value",v.toUpperCase()); </body> </method>
Type: element id, must be unique in the window
A unique identifier so that you can identify the method with. You can use this as a parameter to getElementById and other DOM functions and to reference the element in style sheets.
The name of the method, which is the name used in a script. For example, a method named setSize can accessed with object.setSize().