|
JavaScript 的对象属性
以下的属性可在 JavaScript中用到: action propertyString value of a FORM tag's ACTION attribute.
Applies toExamplesxxx Examples to be supplied. alinkColor propertyRGB value for color of activated links (after mouse-button down, but before mouse-button up), expressed as a hexadecimal triplet. This property is the JavaScript reflection of the ALINK attribute of the HTML BODY tag.
Applies toExamplesxxx Examples to be supplied. anchors propertyArray of objects corresponding to named anchors (<A NAME=""> tags) in source order. The anchors array contains an entry for each anchor in a document. For example, if a document contains three anchors, these anchors are reflected as document.anchors[0], document.anchors[1], and document.anchors[2]. To obtain the number of anchors in a document, use the length property: document.anchors.length.
Applies toExamplesxxx Examples to be supplied. See alsobgColor propertyRGB value of background color, expressed as a hexadecimal triplet. This property is the JavaScript reflection of the BGCOLOR attribute of the HTML BODY tag.
Applies toExamplesxxx Examples to be supplied. checked propertyFor checkbox, Boolean, false if not checked, true if checked. For radioButton, Boolean, false if not pressed, true if pressed.
Applies toExamplesxxx To be supplied. current propertyURL of current page. xxx Not yet implemented in Beta 4.
Applies toExamplesxxx Examples to be supplied. defaultChecked propertyFor checkbox, Boolean property that indicates if the element is selected by default, by the CHECKED attribute. For radioButton, Boolean property that indicates if the element is selected by default, by the CHECKED attribute.
Applies toExamplesxxx Examples to be supplied. defaultSelected propertyBoolean property that indicates if the option is selected by default, by the presence of the SELECTED attribute in the HTML OPTION tag.
Applies toExamplesxxx Examples to be supplied. defaultStatus propertyFor a window, the defaultStatus property reflects the default message displayed in the status bar at the bottom of the window. Do not confuse defaultStatus with status. The status property reflects a priority or transient message in the status bar, such as the message that appears when a mouseOver event occurs over an anchor.
Applies toExamplesxxx Examples to be supplied. defaultValue propertyFor text and textArea, string, the initial contents of the field.
Applies toExamplesxxx Examples to be supplied. E propertyE is Euler's constant, the base of natural logarithms, roughly 2.718.
Applies toExamplesxxx Examples to be supplied. elements property (client)Array of objects corresponding to form elements (such as checkbox, radioButton, and text objects) in source order.The elements array contains an entry for each object in a form. For example, if a form has a text field, a radio button group, and a checkbox, these elements are reflected as formName.elements[0], formName.elements[1], and formName.elements[2].
Applies toExamplesxxx Examples to be supplied. fgColor propertyRGB value of foreground (text) color, expressed as a hexadecimal triplet. This property is the JavaScript reflection of the FGCOLOR attribute of the HTML BODY tag.
Applies toExamplesxxx Examples to be supplied. forms propertyArray of objects corresponding to named forms (<FORM NAME=""> tags) in source order. The forms array contains an entry for each form object in a document. For example, if a document contains three forms, these forms are reflected as document.forms[0], document.forms[1], and document.forms[2]. You can refer to a form's elements by using the forms array. For example, you would refer to a text object named quantity in the second form as: document.forms[1].quantityYou would refer to the value property of this text object as: document.forms[1].quantity.value To obtain the number of forms in a document, use the length property: document.forms.length.
Applies toExamplesxxx Examples to be supplied. See alsoframes propertyArray of objects corresponding to child frame windows (<FRAMESET> tag) in source order. The frames array contains an entry for each child frame in a window. For example, if a window contains three child frames, these frames are reflected as window.frames[0], window.frames[1], and window.frames[2]. To obtain the number of number of child frames in a window, use the length property: window.frames.length.
Applies toExamplesxxx Examples to be supplied. See alsohash propertyThe anchor name following the # symbol.
Applies toExamplesxxx Examples to be supplied. host propertyThe hostname:port part of the location or URL.
Applies toExamplesxxx Examples to be supplied. See alsohostname propertyThe hostname part of the location or URL.
Applies toExamplesxxx Examples to be supplied. See alsohref propertyThe entire URL as a JavaScript string.
Applies toExamplesxxx Examples to be supplied. index propertyFor radioButton, number, the ordinal number of the radioButton field, 0-based. For a select object option, the number identifying the position of the option in the selection, starting from zero.
Applies toExamplesxxx Examples to be supplied. lastModified propertyA string containing the last-modified date.
Applies toExamplesxxx Examples to be supplied. length propertyFor a history object, the length of the history list. For a string object, the integer length of the string. For a radioButton object, the number of radio buttons in the object. For an anchors, forms, frames, links, or options array, the number of elements in the array. For a null string, length is zero.
Applies toExamplesxxx Example with history to be supplied. If the string object mystring is "netscape", then mystring.length returns the integer 8. If the current document contains five forms, then document.forms.length returns the integer 5. linkColor propertyRGB value for color of hyperlinks, expressed as a hexadecimal triplet.
Applies toExamplesxxx Examples to be supplied. links propertyArray of objects corresponding to link objects (<A HREF=URL> tags) in source order. The links array contains an entry for each link object in a document. For example, if a document contains three link objects, these links are reflected as document.links[0], document.links[1], and document.links[2]. To obtain the number of links in a document, use the length property: document.links.length.
Applies toExamplesxxx Examples to be supplied. See alsoLN2 propertyLN2 is the natural logarithm of two, roughly 0.693.
Applies toExamplesxxx Examples to be supplied. LN10 propertyLN10 is the natural logarithm of ten, roughly 2.302.
Applies toExamplesxxx Examples to be supplied. loadedDate propertyxxx Description to be supplied. Not yet implemented in Beta 4.
Applies toExamplesxxx Examples to be supplied. location propertyThe full URL of the document.
Applies toExamplesxxx Examples to be supplied. method propertyValue of METHOD attribute, "get" or "post".
Applies toExamplesxxx Examples to be supplied. name propertyA string whose value is the same as the NAME attribute of the object. Note that for button, reset, and submit objects, this is the internal name for the button, not the label that appears onscreen.
Applies tobutton, checkbox, form, password, radioButton, reset, submit, text, textArea Examplesxxx Examples to be supplied. options propertyArray of objects corresponding to options in a selection object (<OPTION> tags) in source order. The options array contains an entry for each option in a selection object. For example, if a selection object named musicStyle contains three options, these options are reflected as musicStyle.options[0], musicStyle.options[1], and musicStyle.options[2]. To obtain the number of options in a selection object, use the length property: objectName.options.length.
Applies toExamplesxxx Examples to be supplied. See alsoparent propertyIn a <FRAMESET> and <FRAME> relationship, the <FRAMESET> window.
Applies toExamplesxxx Examples to be supplied. pathname propertyThe file or object path name following the third slash.
Applies toExamplesxxx Examples to be supplied. PI propertyPi is the ratio of the circumference of a circle to its diameter, roughly 3.1415.
Applies toExamplesxxx Examples to be supplied. port propertyThe port number in a URL, if any; otherwise "".
Applies toExamplesxxx Examples to be supplied. protocol propertyThe initial substring up to and including the first colon, which indicates the URL's access method.
Applies toExamplesxxx Examples to be supplied. referrer propertyxxx Description to be supplied.
Applies toExamplesxxx Examples to be supplied. search propertyAny query string or form data after ?.
Applies toExamplesxxx Examples to be supplied. selected propertyBoolean property that indicates the current selected state of an option in a select object.
Applies toExamplesxxx Examples to be supplied. selectedIndex propertyxxx to be described
Applies toExamplesxxx Examples to be supplied. self propertyThe self property refers to the current window. Use the self property to disambiguate a window property from a form of the same name. You can also use the self property to make your code more readable.
Applies toExamplesIn the following example, self.status is used to set the status property. This usage disambiguate the status property of a window from a form called "status". See alsoSQRT1_2 propertySQRT1_2 is the square root of one-half; equivalently, one over the square root of two, roughly 0.707.
Applies toExamplesxxx Examples to be supplied. SQRT2 propertySQRT2 is the square root of two, roughly 1.414.
Applies toExamplesxxx Examples to be supplied. status propertyFor a window, the status property reflects a priority or transient message in the status bar at the bottom of the window, such as the message that appears when a mouseOver event occurs over an anchor. Do not confuse status with defaultStatus. The defaultStatus property reflects the default message displayed in the status bar.
Applies toExamplesSuppose you have created a JavaScript function called pickRandomURL() that lets you select a URL at random. You can use the onClick event handler of an anchor to specify a value for the HREF attribute of the anchor dynamically, and the onMouseOver event handler to specify a custom message for the window in the status property: In the above example, the status property of the window is assigned to the window's self property, as self.status. As this example shows, you must return true to set the status property in the onMouseOver event handler. target propertyWindow targeted for form response after the form has been submitted.
Applies toExamplesxxx Examples to be supplied. text propertyString, reflection of the text after the <OPTION> tag.
Applies toExamplesxxx Examples to be supplied. title propertyCurrent document title.
Applies toExamplesxxx Examples to be supplied. |