mozilla
Your Search Results

    StyleSheetList

    この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

    The StyleSheetList interface represents a list of StyleSheet.

    It is an array-like object but can't be iterated over using Array methods. However It can be iterated over in a standard for loop over its indices, or converted to an Array.

    Example

    // Get all CSS rules for the current document using Array methods
    var allCSS = [].slice.call(document.styleSheets)
                         .reduce(function (prev, styleSheet) {
            if (styleSheet.cssRules) {
                return prev +
                    [].slice.call(styleSheet.cssRules)
                            .reduce(function (prev, cssRule) {
                        return prev + cssRule.cssText;
                    });
            } else {
                return prev;
            }
        });

    ドキュメントのタグと貢献者

    Contributors to this page: Sheppy, Zig, ethertank, kscarfone, KthProg, teoli, Reachmeatshivam
    最終更新者: teoli,