JS Object, Property collation

Source: Internet
Author: User
Tags date execution natural logarithm net sin string square root version
js| objects

Windows Object

the top-level object for each HTML document.

Property

Frames[] An array of child frames. Each child frame array is stored in the order defined in the source document.

Feames.length of the number of child frames.

Self Current window.

Parent Parents window (the current window is one of the child windows).

Top top-level window (is the parent window for all visible windows).

The message on the Status Browser state window.

Defaultstatus The default message that appears on the Browser status window when status is not valid.

Name Internal name, which is defined by the window that is opened by the window.open () method.


Method

Alert ("message") Displays the JavaScript Alert dialog box that contains the given message.

Confirm ("message") Displays the "Confirm" dialog box (with an OK button and a Cancel button) that contains the given message. Returns FALSE if the user clicks OK to return true.

The prompt ("message") displays a "Prompt" dialog box that requires the user to give the appropriate input based on the display message.

Open ("URL", "name") opens a new window, giving a specified name.

Close () Closes the current window.

Frame Object


It is the child window of the entire browser window, and it has all the properties of the Window object, except the Status,defaultstatus,name property.


Location Objects


Contains information about the current URL.

Property

href entire URL string.

Protocol A string containing the first part of the URL, such as http:

The host contains a string with the host name: part of the port number in the URL. such as//www.cenpok.net/server/

Hostname A string containing the host name in the URL. such as Http://www.cenpok.net

Port contains a string of port numbers that may exist in the URL.

Pathname after the "/" in the URL. such as ~list/index.htm

The string after the hash "#" (the CGI parameter).

Search "?" String after the number (CGI parameter).


Document Object


An object that contains information about the current document.

Property

Title of the current document, if not defined, contains "untitled".

Location the full URL of the document.

LastModified contains the date the document was last modified.

Referrer the caller URL, which is the URL from which the user is linked to the current page.

bgcolor background color (#xxxxxx)

Fgcolor foreground text color.

LinkColor the hyperlink color.

Vlinkcolor the hyperlink color accessed.

Alinkcolor Activate chain color (when mouse hold is not placed).

Forms[] An array of form objects in the document, stored in a defined order.

Forms.length the number of form objects in the document.

Links[] The array object that corresponds to all the href chains in the document, defining the store in order.

The number of href chains in the Links.length document.

Anchors[] Anchor (...) Array, which defines the storage in order.

Anchors.length the number of anchors in the document.


Method

Write ("string") highlights the string to the current window. (Strings can contain HTML tags)

Writeln ("string") is similar to write (), appending a carriage return at the end, only in the predetermined format text (

...
Or
...
Effect.

Clear () the current window.

Close () Closes the current window.


Form Object


Property

Name

The string value of the Name property in the

Class value of Method attribute in method, "0" = "Get", "1" = "POST".

The string value of the Action property in the action.

Target table data submission is consistent with the corresponding attribute in the tag.

The Elements[index] Elements property contains the individual elements in the form.

The number of elements in the length table.


Method

Submit () Submission form.

Event handler onsubmit () the code that runs when a user clicks a defined button to submit form.


text and TextArea objects

Property

The string value of the name Name property.

The string value for the content of the value field.

DefaultValue the initial string value of the field contents.


Method

Focus () Sets the object input focal point.

Blur () Removes the input focus from the object.

Select () The input area of the selected object.


Event Handlers

Onfocus executes when the input focus is entered.

OnBlur is executed when the domain loses focus.

Onselect executes when some text in a field is selected.

OnChange executes when the domain loses focus and the domain value is changed relative to the onfocus execution.


check box (CheckBox) Object


Property

The string value of the name Name property.

The string value of the contents of the Value check box. On if set, or off.

Boolean value for the contents of the Checked check box. True if set, or false.

defaultchecked reflect (CHECKED) The Boolean value of the property (the default state).


Method

Click () to select the check box and make it state "on".


Event Handlers

OnClick executes when the user clicks the checkbox.


radio button (radio) object


Property

The string value of the name Name property.

Length radio The number of radio buttons in the object.

The string value of the value Value property.

Checked Boolean value, press True, otherwise false.

Defaultchecked A Boolean value that reflects the value of the checked property.


Method

Click () Select the Order button.


event handlers

OnClick executes when the radio button is selected.


Select Object

Property

The number of objects in the length select object.

Name is the internal name of the select object defined by the Name= property.

SelectedIndex the subscript of the currently selected option in the Select object.

Options This property corresponds to the contents of the tag when you define a Select object in HTML, and it has the following properties:

Text string that is marked with text.

Values of the value Value property, which is committed when the submit button is pressed.

Defaultselected A Boolean value that reflects the selected property of the tag.

Selected a Boolean value that reflects the current selection state of option.


Event Handlers

Onfocus executes when the input focus is entered into the domain.

OnBlur is executed when the field loses input focus.

OnChange executes onChange when the domain loses focus and if the value of the domain changes relative to onfocus execution.


Button Object


There are three types of buttons in the table defined by the type attribute in the tag:

. Submit (Type= "Submit")

. Reset (type= "reset")

. Custom (type= "button")

All button objects have the following ingredients:

Property

The string value of the value Value property.

The string value of the name Name property.


Method

Click () Select button


Event Handlers

OnClick executes when the button is clicked.


Submit and Reset Objects


Property

The contents of the Value value= property.

The contents of the name Name= property.


Method

Click () Select button


event handlers

OnClick executes when the button is clicked.


Password Objects


Property

DefaultValue the contents of the Value= property.

The contents of the name Name= property.

Value currently enters the data for the password field.


Method

Focus () takes you to the password field.

Blur removes the focus from the password domain.

Select () selects the current data in the Password field for modification.


Navigator Objects


This object is used to determine the navigator version that is used when the user accesses.

Property

appCodeName "codename" relative to the user's browser

AppName the actual name relative to the user's browser.

AppVersion The version number relative to the user's browser.

UserAgent This property reflects all the information in the user's browser.


String Object


A String object provides a number of ways to manipulate the contents of a string.


Property

Length string, that is, the number of characters in the string.


Method

Big (), Blink (), bold (), fixed (), italics (), small (), sub (), Strike (), SUP (), fontcolor (color), fontsize (size)

The above method adds the appropriate HTML markup for the string.

CharAt (index) returns the character at index in the string.

IndexOf (Searchvalue,[fromindex]) This method searches the string for the first occurrence of the searchvalue. If a fromindex is given, the

The position within the string begins the search, and when Searchvalue is found, returns the position of the first character of the string.

LastIndexOf (Searchvalue,[fromindex]) searches searchvalue from the tail of the string and reports the first instance found.

SUBSTRING (INDEXA,INDEXB) gets the substring from indexa to INDEXB.

toLowerCase (), toUpperCase () converts all characters in the string to uppercase and lowercase.


Date Object


To use the Date object, you must be a date instance:

Variable name =new Date ();

Method

Getday (), GetDate (), getHours (), getminutes (), getmonth (), getseconds (), GetTime (),

getTimezoneOffset (), getyear ()

and Setday ...

toGMTString () returns the current time in GMT format. (sun,12 Feb 1999 14:19:22 GMT)

toLocaleString returns the current time in locale format. (03/11/99 14:19:22)

Parse (date) converts the normal date string to a settime () parameter.


Math Object


Property

LN10 (natural logarithm of 10)

PI (3.1415926 ...)

Sqrt1_2 (square root of 1/2)

Method

ABS (x) returns the absolute value of X

ACOs (x) returns the arc cosine value of X

ASIN (x) returns the arc sin value of x

Atan (x) returns the arc tangent value of X

Ceil (x) returns the smallest integer greater than or equal to X

COS (x) returns the cosine value of X

EXP (x) returns the X-second side of E

Floor (x) returns the largest integer less than or equal to X

Log (x) returns X's

Max (x,y) returns a large value in X,y

MIN (x,y) returns the decimal value in X,y

POW (x,y) returns the Y-second side of X

Round (x) rounded to the nearest integer, (less than or equal to 0.5 decimal places)

Sin (x) returns the sin value of x

SQRT (x) returns the square root of X

Tan (x) returns the tangent value of X

JavaScript several getelementby~ ~ The case must pay attention ~ ~

getElementById
Getelementsbyname
getElementsByTagName




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.