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

The following objects are available in JavaScript:

anchor applet button checkbox Date document form history link location Math password radioButton reset selection string submit text textArea window

NOTE: Each object topic indicates whether the object is part of the client (in Navigator), server (in LiveWire), or is common (built-in to JavaScript). Server objects are not included in this version of the documentation.


anchor object (client)

An anchor is a piece of text identified as the target of a hypertext link.

Syntax

To define an anchor, use standard HTML syntax :

<A NAME="anchorName" anchorText </A>

NAME specifies a tag that becomes an available hypertext target within the current document. anchorText specifies the text to display at the anchor.

Description

You can reference the anchor objects in your code by using the anchors property of the document object. The anchors property is an array that contains an entry for each anchor in a document.

xxx to be supplied

Properties

xxx to be supplied

Methods

xxx to be supplied

Event handlers

None.

Examples

&amp;lt;A NAME=&amp;quot;javascript_intro&amp;quot;&amp;gt;&amp;lt;H2&amp;gt;Welcome to JavaScript&amp;lt;/H2&amp;gt;&amp;lt;/A&amp;gt;

See also

link object anchors property

applet object (client)

Represents a Java applet. xxx NYI.

Syntax

xxx to be supplied

Description

The applet object executes applets written in Java, not JavaScript. Java applets execute only on Netscape 2.0 and HotJava, and only on 32-bit platforms, such as Windows 95, Windows NT, and Unix. They do not execute on the 16-bit Windows platforms, such as Windows 3.1.

Properties

length

Methods

xxx to be supplied

Event handlers

xxx to be supplied

Examples

xxx to be supplied

See also

xxx to be supplied

button object (client)

A button object is a pushbutton on an HTML form.

Syntax

<INPUT TYPE="button" NAME="objectName" VALUE="buttonText" [onClick="handlerText"]> NAME specifies the name of the button object as a property of the enclosing form object and can be accessed using the name property. VALUE specifies the label to display on the button face and can be accessed using the value property.

Description

The button object is a custom button that you can use to perform an action you define.

Properties

name value

Methods

click

Event handlers

onClick

Examples

A custom button does not necessarily load a new page into the client; it merely executes the script specified by the onClick event handler. In the following example, myfunction() is a JavaScript function.