2006.08.25 Friday | 12:28

  ルールの列挙 ふるいむかし

<SCRIPT>
window.onload=fnInit;
function fnInit(){

	var objStyleSheet = document.styleSheets[0];

	var colRules;

	if ( document.all ) {
		colRules = objStyleSheet.rules;
	}
	else {
		colRules = objStyleSheet.cssRules;
	}

	for( i = 0; i < colRules.length; i++ ) {
		alert( colRules[i].selectorText + " : " + colRules[i].style.cssText );
	}

}
</SCRIPT>