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

📄 ref_t-z.htm

📁 javascript函数大全HTML javascript函数大全HTML
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<P>A textarea object on a form looks as follows:
<FORM>
<P><TEXTAREA NAME="item_描述" ROWS=5 COLS=45>
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>
</FORM>
<P>A textarea object is a form element and must be defined within a &LTFORM&GT tag.

<P>textarea objects can be updated (redrawn) dynamically by setting the value property (this.value).

<P>To begin a new line in a textarea object, you can use a newline character. 
This character varies from platform to platform: Unix is \n, Windows is \r\n, and Macintosh is \n. 
One way to enter a newline character programatically is to test the appVersion property to determine the 
current platform and set the newline character accordingly. 
See the <A HREF="ref_a-c.htm#appVersion_property" appVersion_property">appVersion</A> property for an example.


<H3>Properties</H3>
<LI><A HREF="ref_d-e.htm#defaultValue_property" defaultValue_property">defaultValue</A> reflects the VALUE attribute
<LI><A HREF="ref_m-q.htm#name_property" name_property">name</A> reflects the NAME attribute
<LI><A HREF="ref_t-z.htm#value_property" value_property">value</A> reflects the current value of the textarea object


<H3>Methods</H3>
<LI><A HREF="ref_f-g.htm#focus_method" focus_method">focus</A>
<LI><A HREF="ref_a-c.htm#blur_method" blur_method">blur</A>
<LI><A HREF="ref_s-s.htm#select_method" select_method">select</A>


<H3>Event handlers</H3>
<LI><A HREF="ref_m-q.htm#onBlur_event" onBlur_event">onBlur</A>
<LI><A HREF="ref_m-q.htm#onChange_event" onChange_event">onChange</A>
<LI><A HREF="ref_m-q.htm#onFocus_event" onFocus_event">onFocus</A>
<LI><A HREF="ref_m-q.htm#onSelect_event" onSelect_event">onSelect</A>


<H3>例子</H3>
<P>The following example creates a textarea object that is 6 rows long and 55 columns wide. The textarea field appears immediately below the word "描述:". When the form loads, the textarea object contains several lines of data, including one blank line.
<XMP>
<B>描述:</B>
<BR><TEXTAREA NAME="item_描述" 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>

<P>相关 the 例子 for the <A HREF="ref_m-q.htm#onBlur_event" onBlur_event">onBlur</A>, <A HREF="ref_m-q.htm#onChange_event" onChange_event">onChange</A>, <A HREF="ref_m-q.htm#onFocus_event" onFocus_event">onFocus</A>, and <A HREF="ref_m-q.htm#onSelect_event" onSelect_event">onSelect</A> event handlers.


<H3>相关</H3>
<LI><A HREF="ref_f-g.htm#form_object" form_object">form</A>, <A HREF="ref_m-q.htm#password_object" password_object">password</A>, <A HREF="ref_s-s.htm#string_object" string_object">string</A>, and <A HREF="ref_t-z.htm#text_object" text_object">text</A> objects


<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="title_property"><H2>title property</H2></A>
<P>
A string representing the title of a document.

<H3>语法</H3>
<PRE>document.title</PRE>

<H3>Property of</H3>
<P><A HREF="ref_d-e.htm#document_object" document_object">document</A>

<H3>描述</H3>
<P>The title property is a reflection of the value specified within the &ltTITLE&gt and &lt/TITLE&gt tags. If a document does not have a title, the title property is null.

<P>title is a read-only property.

<H3>例子</H3>
<P>In the following example, the value of the title property is assigned to a variable called <I>docTitle</I>:
<PRE>
var newWindow = window.open("http://www.netscape.com")
var docTitle = newWindow.document.title
</PRE>
<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="toGMTString_method"><H2>toGMTString method</H2></A>
<P>
Converts a date to a string, using the Internet GMT conventions.

<H3>语法</H3>
<PRE><I>dateObjectName</I>.toGMTString()</PRE>
<P><I>dateObjectName</I> is either the name of a date object or a property of an existing object.

<H3>用法</H3>
<P><A HREF="ref_d-e.htm#Date_object" Date_object">Date</A>

<H3>描述</H3>
<P>The exact format of the value returned by toGMTString varies according to the platform.

<H3>例子</H3>
In the following example, <I>today</I> is a date object:
<PRE>
today.toGMTString()
</PRE>
<P>
In this example, the toGMTString method converts the date to GMT (UTC) using the operating system's time zone offset and returns a string value that is similar to the following form. The exact format depends on the platform.
<P>
Mon, 18 Dec 1995 17:28:35 GMT

<H3>相关</H3>
<LI><A HREF="ref_t-z.htm#toLocaleString_method" toLocaleString_method">toLocaleString</A> method

<!----------------------------------------------------------------->
<HR>
<A NAME="toLocaleString_method"><H2>toLocaleString method</H2></A>
<P>
Converts a date to a string, using the current locale's conventions.

<H3>语法</H3>
<PRE><I>dateObjectName</I>.toLocaleString()</PRE>
<P><I>dateObjectName</I> is either the name of a date object or a property of an existing object.

<H3>用法</H3>
<P><A HREF="ref_d-e.htm#Date_object" Date_object">Date</A>

<H3>描述</H3>
If you are trying to pass a date using toLocaleString, be aware that different locales assemble the string in different ways. Using methods such as getHours, getMinutes, and getSeconds will give more portable results.

<H3>例子</H3>
In the following example, <I>today</I> is a date object:
<PRE>
today.toLocaleString()
</PRE>
<P>
In this example, toLocaleString returns a string value that is similar to the following form. The exact format depends on the platform.
<P>
12/18/95 17:28:35

<H3>相关</H3>
<LI><A HREF="ref_t-z.htm#toGMTString_method" toGMTString_method">toGMTString</A> method

<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="toLowerCase_method"><H2>toLowerCase method</H2></A>
<P>
Returns the calling string value converted to lower case.

<H3>语法</H3>
<PRE><I>stringName</I>.toLowerCase()</PRE>
<P><I>stringName</I> is any string or a property of an existing object.

<H3>用法</H3>
<P><A HREF="ref_s-s.htm#string_object" string_object">string</A>

<H3>描述</H3>
<P>The toLowerCase method returns the value of <I>stringName</I> converted to lower case. toLowerCase does not affect the value of <I>stringName</I> itself.

<H3>例子</H3>
<P>The following 例子 both yield "alphabet".
<PRE>
var upperText="ALPHABET"
document.write(upperText.toLowerCase())

"ALPHABET".toLowerCase()
</PRE>

<H3>相关</H3>
<LI><A HREF="ref_t-z.htm#toUpperCase_method" toUpperCase_method">toUpperCase</A> method
<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="top_property"><H2>top property</H2></A>
<P>
The top property is a synonym for the top-most Navigator window, which is a "document window" or "Web Browser window."

<H3>语法</H3>
<PRE>
1. top.<I>propertyName</I>
2. top.<I>methodName</I>
3. top.<I>frameName</I>
4. top.frames[<I>index</I>]
</PRE>
<P><I>propertyName</I> is defaultStatus, status, or length.
<BR><I>methodName</I> is any method associated with the window object.
<BR><I>frameName</I> and frames[<I>index</I>] are ways to refer to frames.

<H3>Property of</H3>
<P><A HREF="ref_t-z.htm#window_object" window_object">window</A>

<H3>描述</H3>
<P>The top property refers to the top-most window that contains frames or nested framesets. Use the top property to refer to this ancestor window.

<P>The top property is read-only. The value of the top property is
<PRE>     &ltobject <I>objectReference</I>&gt</PRE>
where <I>objectReference</I> is an internal reference.

<H3>例子</H3>
<P>The statement <TT>top.close()</TT> closes the top-most ancestor window.

<P>The statement <TT>top.length</TT> specifies the number of frames contained within the top-most ancestor window. When the top-most ancestor is defined as follows, <TT>top.length</TT> returns 3:
<PRE>
&ltFRAMESET COLS="30%,40%,30%"&gt
&ltFRAME SRC=child1.htm NAME="childFrame1"&gt
&ltFRAME SRC=child2.htm NAME="childFrame2"&gt
&ltFRAME SRC=child3.htm NAME="childFrame3"&gt
&lt/FRAMESET&gt
</PRE>

<P>The following example sets the background color of a frame called <I>myFrame</I> to red. <I>myFrame</I> is a child of the top-most ancestor window.
<PRE>
top.myFrame.document.bgColor="red"
</PRE>

<!------------------------------------------------------------------------------------------------->
<HR>
<A NAME="toUpperCase_method"><H2>toUpperCase method</H2></A>
<P>
Returns the calling string value converted to upper case.

<H3>语法</H3>
<PRE><I>stringName</I>.toUpperCase()</PRE>
<P><I>stringName</I> is any string or a property of an existing object.

<H3>用法</H3>
<P><A HREF="ref_s-s.htm#string_object" string_object">string</A>

<H3>描述</H3>
<P>The toUpperCase method returns the value of <I>stringName</I> converted to upper case. toUpperCase does not affect the value of <I>stringName</I> itself.

<H3>例子</H3>
<P>The following 例子 both yield "ALPHABET".
<PRE>
var lowerText="alphabet"
document.write(lowerText.toUpperCase())

"alphabet".toUpperCase()
</PRE>

<H3>相关</H3>
<LI><A HREF="ref_t-z.htm#toLowerCase_method" toLowerCase_method">toLowerCase</A> method

<!------------------------------------------------------------------------------------------------>
<HR>
<A NAME="unescape_method"><H2>unescape function</H2></A>
<P>Returns the ASCII string for the specified value.

<H3>语法</H3>
<PRE>unescape("<i>string</i>")</PRE>
<P><I>string</I> is a string or a property of an existing object, containing characters in either of the following forms:
<LI>"%<I>integer</I>", where <I>integer</I> is a number between 0 and 255 (decimal)
<LI>"<I>hex</I>", where <I>hex</I> is a number between 0x0 and 0xFF (hexadecimal)

<H3>描述</H3>
<P>The unescape function is not a method associated with any object, but is part of the language itself.

<P>The string returned by the unescape function is a series of characters in the ISO Latin-1 character set.


⌨️ 快捷键说明

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