JavaScript Reference/Javascript Collections/scripts
Версия от 18:30, 25 мая 2010; (обсуждение)
Содержание
"scripts" Example
<html>
<body>
<button onclick="getTotal();">Get total script tags</button>
<script language="JavaScript">
function getTotal() {
var m = document.scripts.length;
alert(m);
}
</script>
<script language="JavaScript"></script>
</body>
</html>
"scripts" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |document |
+----------------+--------------------------------------------------------------+
"scripts" JavaScript properties and JavaScript methods
JavaScript properties and JavaScript methods
item(), length, namedItem(), tags(), urns()
"scripts" Syntax Parameters and Note
Note:
Returns an array of all <script> elements in a document.
Syntax:
document.scripts // returns all scripts
document.scripts(param1, param2) // returns an individual script
Parameters:
param1 Required; zero-based index
desired member"s id or name attribute.
param2 Optional; the zero-based index for the result returned
if param1 matches more than one element.