Common JavaScript objects. Properties

xiaoxiao2021-03-06  40

View the topic in text - Xi'an Information Resource Network (http://bbs.infoxa.com/index.asp) - Learning and Development (http://bbs.infoxa.com/list.asp?boardid=9) --- Commonly used JavaScript objects. Properties (http://bbs.infoxa.com/dispbbs.asp?boardid=9&id=159)

- Author: lx_csc-- Published: 2004-10-2811: 05: 39-- commonly used JavaScript object properties SCRIPT tag is used to contain JavaScript code attribute LANGUAGE defined scripting language SRC defines a URL to specify... The file Window object ends for each HTML document. Attributes Frames [] subride array. Each subrill array is stored in the order defined in the source document. Self Current window. Parent Father Window (The current window is a sub-window). The top layer window (the parent window of all visible windows). The message on the Status Browser Status window. DefaultStatus appears on the Browser Status window when Status is invalid, the default message on the browser status window. Name internal name, the name defined by a window opened by a Window.Open () method. Method Alert ("Message) displays the" JavaScript Alert "dialog containing a given message. Confirm (" Message) displays with a given message "Confirm" dialog (with a OK button and a Cancel button). If the user comes to returns true, otherwise returns false. Prompt ("message") Displays a "prompt" dialog, requiring the user to give the corresponding Enter. Open ("URL", "Name") Opens a new window to give a specified name. Close () Close the current window. Frame object It is the sub-window of the entire browser window, except STATUS, DEFAULTSTATUS, NAME attribute It has all the properties of the Window object. Location object contains information about the current URL. Properties href entire URL string. Protocol contains a string of the first part of the URL, such as http: Host contains the host name in the URL: the string of the port number .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Subsequent part. String after ~ List / Index.htm Hash "#" (CGI parameter). String after the Search "?" (CGI parameter). Document object contains the object of the current document information. Properties Title Current document title, if not defined, the full url of "Untitled". Location Document contains the last modification date of the document. The ReferRerator URL, that is, which URL is linked from the current page. BGColor background color (# XXXXXX) FGColor Prospect Text Color. LinkColor Hyperlink Color. VLINKCOLOR Access the super chain color. AlinkColor activation chain color (Mouse holds down the error). The array of Form objects in the document is stored. Forms. The number of FORM objects in the Length documentation. Links [] corresponds to the array objects corresponding to all HREF chains in the document. The number of href chains in the links.length document. Anchors [] Anchor (...) array, in order Define storage. Anchors.Length document Number of anchors. Method Write ("string" highlights the string to the current window. (String can contain HTML tags) Writeln ("string") is similar, at the end Entering, only in the predetermined format text. CLOAR () clear the current window. Close () Close the current window. FORM object property Name string value of the Name attribute in the name of the name attribute in Method, "0" = "Get", "1" = "

POST ". Action value of the action attribute in action. Target submitted by Target Table data, consistent with the corresponding attributes in the tag. Elements [index] Elements property contains individual elements in the form. The number of elements in the LENGTH table. Method SUBMIT ) Submit form. Event Processor OnSubmit () User Click a defined button to submit the code running when the Form is running. Text and TextArea object properties Name Name properties string value. Value domain content string value. DefaultValue domain content Initial string value. Method FOCUS () Sets the object input focus. Blur () removes the input focus on the object. Select () Select the input area of ​​the object. Event processor onfocus is executed when entering the focus. Onblur is lost Perform the focus. Onsect is executed when some text is selected in the domain. Onchange is executed when the domain is lost, the domain value is executed when there is changed to the onfocus. Check box (checkbox) Object Property Name Name Property string value The Value check box content string value. If set, "ON", otherwise, "OFF". Checked check box content Boolean value. If set, True, otherwise false. defaultChecked (Checked) Boolean (default). Method Click () Select the check box and make the status "ON". Event Processor OnClick is executed when the user clicks CheckBox. Single button (Radio) Object Property Name Name Attribute string value. The number of radio buttons in the LENGTH Radio object. Value Value property string value. Checked Boolean value, press True, otherwise false. DefaultChecked reflects the boolean value of the check attribute value Method Click () Select the radio button. Event Processor OnClick When the radio button is selected, execute the number of objects in the object object attribute. Name is the internal name of the SELECT object defined by name = attribute. The SELECTEDEX SELECT object is currently selected to subscript. Options This property corresponds to the content in the tag when defining the Select object in HTML, which has the following properties: text strings after the Text mark. Value The value of the value attribute, when the Submit button is pressed, the value is submitted. DefaultSelected reflects the Boolean value of the SELECTED attribute of the tag. Selected reflects the Boolean value of the currently selected state of the Option. Event processor onfocus is executed when entering the field . Onblur is executed when the domain lost the input focus. Onchange is lost when the domain is lost and if the domain changes to the ONFOCUS, there are three types of buttons in the ONCHANGE. Button object table, which is defined by the TYPE attribute in the tag: .submit (Type = "submit"). Reset (Type = "reset") .Custom (type = "button") All button objects have the following ingredients: the character string value of the value value value attribute. Name name property string Value. Method Click () Selection button Event Processor OnClick This is executed when the button is clicked. Submit and reset object properties value value value = Property content. Name name = content. Method Click () selected button event processor OnClick is executed when the button is clicked. Password object property defaultValue value = content of the property. Name name =

转载请注明原文地址:https://www.9cbs.com/read-65249.html

New Post(0)