Definition and Usage..
The embeds collection returns a collection of all elements in the document.
Note: The elements in the collection are sorted as they appear in the source code
Syntax: document.embeds
CODING:The embeds collection returns a collection of all
Note: The elements in the collection are sorted as they appear in the source code
Syntax: document.embeds
<!DOCTYPE html>
<html>
<body>
<embed src="flash1.swf">
<embed src="flash2.swf">
<p>Click the button to display the number of embed elements there are in this document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.embeds.length;
//document.embeds[index]; or document.embeds.items(index) or document.embeds.namedItem(id);
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
<html>
<body>
<embed src="flash1.swf">
<embed src="flash2.swf">
<p>Click the button to display the number of embed elements there are in this document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.embeds.length;
//document.embeds[index]; or document.embeds.items(index) or document.embeds.namedItem(id);
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
Comments
Post a Comment