- Prototype Tutorial
- Prototype - Home
- Prototype - Short Overview
- Prototype - Useful Features
- Prototype - Utility Methods
- Prototype - Element Object
- Prototype - Number Processing
- Prototype - Strings Processing
- Prototype - Array Processing
- Prototype - Hash processing
- Prototype - Basic Object
- Prototype - Templating
- Prototype - Enumerating
- Prototype - Event Handling
- Prototype - Form Management
- Prototype - JSON Support
- Prototype - AJAX Support
- Prototype - Expressing Ranges
- Prototype - Periodical Execution
- Prototype Useful Resources
- Prototype - Quick Guide
- Prototype - Useful Resources
- Prototype - Discussion
Prototype - Form.Element select() Method
This method selects the current text in a text input.
Syntax
formElement.select();
Return Value
It returns selected HTML Element.
Example
<html> <head> <title>Prototype examples</title> <script type = "text/javascript" src = "/javascript/prototype.js"></script> <script> function showResult() { var elem = $('searchbox'); Form.Element.select(elem) } </script> </head> <body> <p>Enter some value click the button to see the result.</p> <br /> <form id = "example" action = "#"> <fieldset> <div> <label for = "searchbox">Search</label> <input id = "searchbox" name = "searchbox" type = "text"> </div> <div> <input value = "Result" type = "button" onclick = "showResult();"> </div> </fieldset> </form> </body> </html>
Output
prototype_form_management.htm
Advertisements