如何在 JavaScript 中使用 document.embeds?
htmljavascriptprogramming scripts更新于 2026/1/13 11:24:17
使用 JavaScript 中的 document.embeds 属性获取文档中的 <embeds> 标签数量。
示例
您可以尝试运行以下代码以在 JavaScript 中实现 document.embeds 属性。
<!DOCTYPE html>
<html>
<head>
<title>JavaScript 示例</title>
</head>
<body>
<embed src = "/html/yourfile.mid" width = "250" height = "100" />
<script>
var num = document.embeds.length;
document.write("<br>How many embed tags: "+num);
</script>
</body>
</html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

