Prototype - $F() 方法
$F() 函数返回任何字段输入控件的值,例如文本框或下拉列表。这是 Form.Element.getValue 的便捷别名。
该函数可以将元素 ID 或元素对象本身作为参数。
语法
$F(element)
返回值
表单的元素值。
示例
<html>
<head>
<title>Prototype examples</title>
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
<script>
function ShowValue() {
var value = $F('userName');
alert( 'Entred Value :' + value);
}
</script>
</head>
<body>
<p>Enter any value in the box and then click "Show Value"</p>
<form>
<input type = "text" id = "userName" value = "Madisetti, Praveen">
<br/>
<input type = "button" value = "Show Value" onclick = "ShowValue();"/>
</form>
</body>
</html>
输出
prototype_utility_methods.html

