Element.select() Method
Name
Element.select() Method---select the text in form element
Navigator 2.0, Internet Explorer 3.0
The select() method selects the text displayed
in a Text, Textarea, Password, or FileUpload
element. The effects of selecting
text may vary from platform to platform, but typically
invoking this method produces the same effect as if the user
had dragged the mouse across all the text in the specified
Text object. On most platforms, this produces the following
effects:
- The text is highlighted, often displayed with colors
reversed.
- If the text remains selected the next time the user types a
character, then the selected text will be deleted and
replaced with the newly typed character.
- The text becomes available for cut-and-paste.
The user can usually deselect text by clicking in the Text
object or by moving the cursor. Once deselected, the user
can add and delete individual characters without replacing
the entire text value.
Selecting a string in a Text object like this can be useful
when you want to allow the user to accept the string as it
is or to replace it entirely and enter a new value from
scratch.
On Unix platforms in Navigator 2.0 and 3.0, the
select() method only works for the Text
element, and not for the Textarea, Password or FileUpload
elements.
Element.options[]
Element.selectedIndex
file: /Techref/language/JAVA/script/definitive/refp_112.htm,
5KB, , updated: 2019年10月14日 16:00, local time: 2025年9月21日 19:57,
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Questions?<A HREF="http://techref.massmind.org/techref/language/JAVA/script/definitive/refp_112.htm"> [Chapter 21] Reference: Element.select()</A>
Did you find what you needed?
Welcome to massmind.org!
Welcome to techref.massmind.org!
.