- 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
广告