document.anchors

지원이 중단되었습니다: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Document 인터페이스의 anchors 읽기 전용 속성은 문서 내의 모든 앵커 목록을 반환합니다.

예제

js
if (document.anchors.length >= 5) {
  dump("dump found too many anchors");
  window.location = "http://www.google.com";
}

알아두기

이전 버전과의 호환성을 제공하기 위해, 반환된 anchor들의 목록은 name 속성(attribute)으로 생성된 anchors들만 포함하고 id 속성(attribute)으로 생성된 것들은 포함하지 않습니다.

브라우저 호환성

BCD tables only load in the browser