⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 append1.html

📁 javascript中文教程 <INPUT TYPE="button" NAME="objectName" VALUE="buttonText" [onClick="hand
💻 HTML
📖 第 1 页 / 共 3 页
字号:
   TYPE="reset"
   VALUE="<I>buttonText</I>"
   [onClick="<I>handlerText</I>"]&GT
</PRE>
<I>VALUE</I> specifies the text to display on the button face and can be accessed using the value property.


<H3>Description</H3>
<P>A reset button resets all elements in a form to their defaults.


<H3>Properties</H3>
<LI><A HREF=props.html#name_property>name</A>
<LI><A HREF=props.html#value_property>value</A>


<H3>Methods</H3>
<LI><A HREF=methods.html#click_method>click</A>


<H3>Event handlers</H3>
<LI><A HREF=events.html#onClick_event>onClick</A>


<H3>Examples</H3>
<P>The following example displays a text object containing "CA". If the user types a different state abbreviation in the text object and then clicks the Clear Form button, the original value of "CA" is restored.
<XMP>
<B>State: </B><INPUT TYPE="text" NAME="state" VALUE="CA" SIZE="2">
<P><INPUT TYPE="reset" VALUE="Clear Form">
</XMP>


<H3>See also</H3>
<LI><A HREF=#button_object>button</A> and <A HREF=#submit_object>submit</A> objects


<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="selection_object"><H2>selection object (client)</H2></A>
<! xxx ->
<! xxx Brendan wonders if this should be "select object", to match the syntax. ->
<! xxx Note that link and radioButton have similar inconsistencies. ->
<! xxx ->
<P>A selection object is a selection list or scrolling list on an HTML form. A selection list lets the user choose one item from a list. A scrolling list lets the user choose one or more items from a list.


<H3>Syntax</H3>
<P>To define a selection object, use standard HTML syntax with the addition of the onBlur, onChange, and onFocus event handlers:
<PRE>
&LTSELECT
   NAME="<I>objectName</I>"
   [SIZE="<I>value</I>"]
   [MULTIPLE]
   [onBlur="<I>handlerText</I>"]
   [onChange="<I>handlerText</I>"]
   [onFocus="<I>handlerText</I>"]&GT
   &LTOPTION [SELECTED]&GT <I>textToDisplay</I> [ ... &LTOPTION&GT <I>textToDisplay</I>]
&LT/SELECT&GT
</PRE>

<P><I>SIZE</I> specifies the number of options visible when the form is displayed.


<H3>Description</H3>
<P>You can reference the options of a selection object in your code by using the options property. The options property is an array that contains an entry for each option in a selection object. Each option has the properties listed below.

<P>The options on selection objects can be updated dynamically. xxx NYI.


<H3>Properties</H3>
<! xxx ->
<! xxx This needs to be thought through. In PROPS.HTML, the options properties say ->
<! xxx they apply to selection object. Need to improve. ->
<! xxx ->
<P>The selection object has the following properties:
<LI><A HREF=props.html#options_property>options</A>
<LI><A HREF=props.html#selectedIndex_property>selectedIndex</A>
<P>The options property has the following properties:
<LI><A HREF=props.html#defaultSelected_property>defaultSelected</A>
<LI><A HREF=props.html#index_property>index</A>
<LI><A HREF=props.html#selected_property>selected</A>
<LI><A HREF=props.html#text_property>text</A>
<LI><A HREF=props.html#value_property>value</A>


<H3>Methods</H3>
<LI><A HREF=methods.html#click_method>click</A>


<H3>Event handlers</H3>
<LI><A HREF=events.html#onBlur_event>onBlur</A>
<LI><A HREF=events.html#onChange_event>onChange</A>
<LI><A HREF=events.html#onFocus_event>onFocus</A>


<H3>Examples</H3>
<P>The following example displays a selection list.
<XMP>
Choose the music type for your free CD:
<SELECT NAME="music_type_single">
   <OPTION SELECTED> R&B <OPTION> Jazz <OPTION> Blues <OPTION> New Age</SELECT>
<P>Choose the music types for your free CDs:
<BR><SELECT NAME="music_type_multi" MULTIPLE>
   <OPTION SELECTED> R&B <OPTION> Jazz <OPTION> Blues <OPTION> New Age</SELECT>
</XMP>


<H3>See also</H3>
<LI><A HREF=#radioButton_object>radioButton</A> object
<LI><A HREF=props.html#options_property>options</A> property

<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="string_object"><H2>string object (common)</H2></A>
<P>A string object consists of a series of characters.


<H3>Syntax</H3>
<PRE><I>stringName</I>.<I>property</I>|<I>method</I></PRE>
<I>stringName</I> is the name of a string variable.
<BR><I>property</I> is one of the properties listed below.
<BR><I>method</I> is one of the methods listed below.


<H3>Description</H3>
<P>A string can be represented as a literal enclosed by single or double quotes; for example, "Netscape" or 'Netscape'.


<H3>Properties</H3>
<LI><A HREF=props.html#length_property>length</A>


<H3>Methods</H3>
<LI><A HREF=methods.html#anchor_method>anchor</A>
<LI><A HREF=methods.html#big_method>big</A>
<LI><A HREF=methods.html#blink_method>blink</A>
<LI><A HREF=methods.html#bold_method>bold</A>
<LI><A HREF=methods.html#charAt_method>charAt</A>
<LI><A HREF=methods.html#fixed_method>fixed</A>
<LI><A HREF=methods.html#fontcolor_method>fontcolor</A>
<LI><A HREF=methods.html#fontsize_method>fontsize</A>
<LI><A HREF=methods.html#indexOf_method>indexOf</A>
<LI><A HREF=methods.html#italics_method>italics</A>
<LI><A HREF=methods.html#lastIndexOf_method>lastIndexOf</A>
<LI><A HREF=methods.html#link_method>link</A>
<LI><A HREF=methods.html#small_method>small</A>
<LI><A HREF=methods.html#strike_method>strike</A>
<LI><A HREF=methods.html#sub_method>sub</A>
<LI><A HREF=methods.html#substring_method>substring</A>
<LI><A HREF=methods.html#sup_method>sup</A>
<LI><A HREF=methods.html#toLowerCase_method>toLowerCase</A>
<LI><A HREF=methods.html#toUpperCase_method>toUpperCase</A>


<H3>Event handlers</H3>
<P>
None. Built-in objects do not have event handlers.


<H3>Examples</H3>
<P>The following statement creates a string variable.
<XMP>
var last_name = "Schaefer"
</XMP>

<P><TT>last_name.length</TT> is 8.
<BR><TT>last_name.toUpperCase()</TT> is "SCHAEFER".
<BR><TT>last_name.toLowerCase()</TT> is "schaefer".


<H3>See also</H3>
<LI><A HREF=#text_object>text</A> and <A HREF=#textarea_object>textArea</A> objects


<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="submit_object"><H2>submit object (client)</H2></A>
<P>A submit object is a submit button on an HTML form.


<H3>Syntax</H3>
<P>To define a submit button, use standard HTML syntax with the addition of the onClick event handler:
<PRE>
&LTINPUT
   TYPE="submit"
   NAME="<I>objectName</I>"
   VALUE="<I>buttonText</I>"
   [onClick="<I>handlerText</I>"]&GT
</PRE>
<I>VALUE</I> specifies the text to display on the button face and can be accessed using the value property.


<H3>Description</H3>
<P>A submit button causes a form to be submitted.

<P>Clicking a submit button submits a form to the program specified by the form's action property. This action always loads a new page into the client; it may be the same as the current page, if the action so specifies or is not specified.


<H3>Properties</H3>
<LI><A HREF=props.html#name_property>name</A>
<LI><A HREF=props.html#value_property>value</A>


<H3>Methods</H3>
<LI><A HREF=methods.html#click_method>click</A>


<H3>Event handlers</H3>
<LI><A HREF=events.html#onClick_event>onClick</A>


<H3>Examples</H3>
<XMP>
<INPUT TYPE="submit" NAME="submit_button" VALUE="Done">
</XMP>


<H3>See also</H3>
<LI><A HREF=#reset_object>reset</A> and <A HREF=#button_object>button</A> objects


<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="text_object"><H2>text object (client)</H2></A>
<P>A text object is a text input field on an HTML form. A text field lets the user enter a word, phrase, or series of numbers.


<H3>Syntax</H3>
<P>To define a text object, use standard HTML syntax with the addition of the onBlur, on Change, onFocus, and onSelect event handlers:
<PRE>
&LTINPUT
   TYPE="text"
   NAME="<I>objectName</I>"
   VALUE="<I>textValue</I>"
   SIZE=<I>integer</I>
   [onBlur="<I>handlerText</I>"]
   [onChange="<I>handlerText</I>"]
   [onFocus="<I>handlerText</I>"]
   [onSelect="<I>handlerText</I>"]&GT
</PRE>


<H3>Description</H3>
<P>text objects can be updated dynamically by setting this.value
<P>xxx to be supplied


<H3>Properties</H3>
<LI><A HREF=props.html#defaultValue_property>defaultValue</A>
<LI><A HREF=props.html#name_property>name</A>
<LI><A HREF=props.html#value_property>value</A>


<H3>Methods</H3>
<LI><A HREF=methods.html#focus_method>focus</A>
<LI><A HREF=methods.html#blur_method>blur</A>
<LI><A HREF=methods.html#select_method>select</A>


<H3>Event handlers</H3>
<LI><A HREF=events.html#onBlur_event>onBlur</A>
<LI><A HREF=events.html#onChange_event>onChange</A>
<LI><A HREF=events.html#onFocus_event>onFocus</A>
<LI><A HREF=events.html#onSelect_event>onSelect</A>


<H3>Examples</H3>
<XMP>
<B>Last name:</B> <INPUT TYPE="text" NAME="last_name" VALUE="" SIZE=25>
</XMP>


<H3>See also</H3>
<LI><A HREF=#textarea_object>textArea</A> and <A HREF=#string_object>string</A> objects


<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="textArea_object"><H2>textArea object (client)</H2></A>
<P>A textArea object is a multiline input field on an HTML form. A textArea field lets the user enter words, phrases, or numbers.


<H3>Syntax</H3>
<P>To define a text area, use standard HTML syntax with the addition of the onBlur, onChange, onFocus, and onSelect event handlers:
<PRE>
&LTTEXTAREA
   NAME="<I>objectName</I>"
   ROWS="<I>integer</I>"
   COLS="<I>integer</I>"
   [onBlur="<I>handlerText</I>"]
   [onChange="<I>handlerText</I>"]
   [onFocus="<I>handlerText</I>"]
   [onSelect="<I>handlerText</I>"]&GT
   <I>textToDisplay</I>
&LT/TEXTAREA&GT
</PRE>
<P><I>textToDisplay</I> allows only ASCII text, and new lines are respected.
<BR><I>ROWS</I> and <I>COLS</I> define the physical size of the displayed input field in numbers of characters.


<H3>Description</H3>
<P>textArea objects can be updated dynamically. xxx need to explain how. (see text object)


<H3>Properties</H3>
<LI><A HREF=props.html#defaultValue_property>defaultValue</A>
<LI><A HREF=props.html#name_property>name</A>
<LI><A HREF=props.html#value_property>value</A>


<H3>Methods</H3>
<LI><A HREF=methods.html#focus_method>focus</A>
<LI><A HREF=methods.html#blur_method>blur</A>
<LI><A HREF=methods.html#select_method>select</A>


<H3>Event handlers</H3>
<LI><A HREF=events.html#onBlur_event>onBlur</A>
<LI><A HREF=events.html#onChange_event>onChange</A>
<LI><A HREF=events.html#onFocus_event>onFocus</A>
<LI><A HREF=events.html#onSelect_event>onSelect</A>


<H3>Examples</H3>
<XMP>
<B>Description:</B>
<BR><TEXTAREA NAME="item_description" ROWS=6 COLS=55>
Our storage ottoman provides an attractive way to
store lots of CDs and videos--and it's versatile
enough to store other things as well.

It can hold up to 72 CDs under the lid and 20 videos
in the drawer below.
</TEXTAREA>
</XMP>


<H3>See also</H3>
<LI><A HREF=#text_object>text</A> and <A HREF=#string_object>string</A> objects


<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="window_object"><H2>window object (client)</H2></A>
<P>A window object is the top-level object for each document, location, and history object group.


<H3>Syntax</H3>
xxx to be supplied


<H3>Description</H3>
<P>The window object is the top-level object in the JavaScript client hierarchy. Because the existence of the current window is assumed, you don't have to reference the name of the window when you call its methods and assign its properties. For example, <TT>status="Jump to a new location"</TT> is a valid property assignment, and <TT>close()</TT> is a valid method call.

<P>The self and window properties are synonyms for the current window, and you can optionally use them to refer to the current window. For example, you can close the current window by calling either <TT>window.close()</TT> or <TT>self.close()</TT>. You can use these properties to make your code more readable, or to disambiguate the property assignment <TT>self.status</TT> from a form called <TT>status</TT>.

<P>See the methods and properties listed below for more examples.

<P>You can reference a window's frame objects in your code by using the frames property. The frames property is an array that contains an entry for each frame in a window.


<H3>Properties</H3>
<LI><A HREF=props.html#frames_property>frames</A>
<LI><A HREF=props.html#parent_property>parent</A>
<LI><A HREF=props.html#self_property>self</A>
<LI><A HREF=props.html#top_property>top</A>
<LI><A HREF=props.html#status_property>status</A>
<LI><A HREF=props.html#defaultStatus_property>defaultStatus</A>


<H3>Methods</H3>
<LI><A HREF=methods.html#alert_method>alert</A>
<LI><A HREF=methods.html#close_method>close</A>
<LI><A HREF=methods.html#confirm_method>confirm</A>
<LI><A HREF=methods.html#open_method>open</A>
<LI><A HREF=methods.html#prompt_method>prompt</A>
<LI><A HREF=methods.html#setTimeout_method>setTimeout</A>
<LI><A HREF=methods.html#clearTimeout_method>clearTimeout</A>


<H3>Event handlers</H3>
<LI><A HREF=events.html#onLoad_method>onLoad</A>
<LI><A HREF=events.html#onUnload_method>onUnload</A>


<H3>Examples</H3>
<P>
xxx to be supplied


<H3>See also</H3>
<LI><A HREF=#document_object>document</A> object
<LI><A HREF=props.html#frames_property>frames</A> property


</BODY>
</HTML>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -