- Prototype 教程
- Prototype - 首頁
- Prototype - 簡要概述
- Prototype - 有用功能
- Prototype - 實用方法
- Prototype - 元素物件
- Prototype - 數字處理
- Prototype - 字串處理
- Prototype - 陣列處理
- Prototype - 雜湊處理
- Prototype - 基本物件
- Prototype - 模板化
- Prototype - 列舉
- Prototype - 事件處理
- Prototype - 表單管理
- Prototype - JSON 支援
- Prototype - AJAX 支援
- Prototype - 表達範圍
- Prototype - 定期執行
- Prototype 實用資源
- Prototype - 快速指導
- Prototype - 實用資源
- Prototype - 討論
原型 - Form.Element select() 方法
此方法選中文字輸入框中的當前文字。
語法
formElement.select();
返回值
它返回選中的 HTML 元素。
示例
<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>
輸出
prototype_form_management.htm
廣告