JS的document.links函数使用示例

Posted tanxiang6690

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JS的document.links函数使用示例相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>JS的document.links函数使用示例</title>
    </head>
    <body>
        <img src="planets.gif" width="145" height="126" usemap="#planetmap" />

        <map name="planetmap">
            <area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm" />
        </map>
        
        Number of links in this document:
        <script type="text/javascript">
            document.write(document.links.length);
            document.write(document.links[0].id);
        </script>
    </body>
</html>

以上是关于JS的document.links函数使用示例的主要内容,如果未能解决你的问题,请参考以下文章