此方法收集散列的值并将它们返回到数组中。
语法
hash.values();
返回值
返回所有值的数组。
例子
HTML
x
23
23
1
<html>
2
<head>
3
<title>Prototype examples</title>
4
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
5
6
<script>
7
function showResult() {
8
var h = $H({ name: 'Prototype', version: 1.6 });
9
var arr = h.values();
10
arr.each(function(item) {
11
alert(item );
12
});
13
}
14
</script>
15
</head>
16
17
<body>
18
<p>Click the button to see the result.</p>
19
<br />
20
<br />
21
<input type = "button" value = "Result" onclick = "showResult();"/>
22
</body>
23
</html>
阅读剩余 34%
作者:terry,如若转载,请注明出处:https://www.web176.com/prototype_api/8700.html