Document.styleSheetSets

지원이 중단되었습니다: 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.

비표준: 이 기능은 비표준이므로 실제 프로덕션에서 사용하지 마세요. 모든 사용자 환경에서 작동하지 않을 수 도 있으며, 미래에 호환성 문제가 생길 수 있습니다.

**styleSheetSets**의 읽기 전용 속성은 현재 사용 가능한 모든 스타일 시트 세트의 live 리스트를 반환합니다.

문법

js
var sets = document.styleSheetSets;

반환시, sets는 사용할 수 있는 스타일 시트 세트의 리스트.

예시

ID가 "sheetList"인 <ul> (list) 요소가 주어지면, 사용 가능한 모든 스타일 시트 세트의 이름으로 아래와 같은 코드로 채울 수 있습니다.

js
let list = document.getElementById("sheetList");
let sheets = document.styleSheetSets;

list.innerHTML = "";

for (let i = 0; i < sheets.length; i++) {
  let item = document.createElement("li");

  item.innerHTML = sheets[i];
  list.appendChild(item);
}

Notes

사용 가능한 스타일 시트 세트 리스트는 문서에 사용 가능한 모든 스타일 시트를 열거하여 구성되고, document.styleSheets 속성에 나열된 순서대로, 리스트에 제목을 가진 각각의 스타일 시트 title을 추가합니다. 중복 항목이 리스트에서 삭제됨. (대소문자 구분 비교 사용).

브라우저 호환성

BCD tables only load in the browser

더보기