RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:9:30-18:00
你可能遇到了下面的问题
关闭右侧工具栏
JavaScript的方法
  • 作者:xiaoxiao
  • 发表时间:2020-12-23 11:03
  • 来源:未知

JavaScript的方法

以下的一些"方法"可用在JavaScript:

abs acos alert anchor asin assign atan back big blink blur bold ceil charAt clear clearTimeout click close confirm cos eval exp fixed floor focus fontcolor fontsize forward getDate getDay getHours getMinutes getMonth getSeconds getTime getTimeZoneoffset getYear go indexOf italics lastIndexOf link log max min open parse pow prompt random round select setDate setHours setMinutes setMonth setSeconds setTimeout setTime setYear sin small sqrt strike sub submit substring sup tan toGMTString toLocaleString toLowerCase toString toUpperCase UTC write writeln

abs method

Returns the absolute value of its argument.

Syntax

abs(arg)

Applies to

Math

Examples

xxx Examples to be supplied.


acos method

Returns the arc cosine (in radians) of its argument.

Syntax

acos(arg)

Applies to

Math

Examples

xxx Examples to be supplied.

See also

asin, atan, cos, sin, tan methods

alert method

Displays an Alert dialog box with a message and an OK button.

Syntax

alert("message")

The argument message is any string.

Description

Use the alert method to display a message that does not require a user decision. The message argument specifies a message that the dialog box contains.

Applies to

window

Examples

In the following example, the testValue function checks the name entered by a user in the text element of a form to make sure that it is no more than eight characters in length. This example uses the alert method to prompt the user of an application to enter a valid value.

function testValue(textElement) { if (textElement.length > 8) { alert("Please enter a name that is 8 characters or less") } }You can call the testValue function in the onBlur event handler of a form's text element, as shown in the following example: Name: <INPUT TYPE="text" NAME="userName" onBlur="testValue(userName)">

See also

confirm, prompt methods

anchor method

Causes the calling string object to be a named anchor by surrounding it with HTML anchor tags, <A NAME=...> </A>.

Syntax

string.anchor(name)

The argument name can be any string.

Description

xxx Description to be supplied.

Applies to

string

Examples

xxx Examples to be supplied.

See also

link method

asin method

Returns the arc sine (in radians) of its argument.

Syntax

asin(arg)

Applies to

Math

Examples

xxx Examples to be supplied.

See also

acos, atan, cos, sin, tan methods

assign method

Sets