IE6は属性セレクタまたは子セレクタをサポートしていないため、これはまったく機能しません。 ie7-jsを使用していますか?
[OK]を参照してください。これはIEのバグのようです(th
とsortOrder
にはdiv
とtitle
を使用して同じ問題があります)。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
th[sortOrder="0"] {color:red}
th[sortOrder="1"] {color:blue}
</style>
<script>
function changeSortOrder() {
// swap the orders so that blue is actually red and vice versa
document.getElementById("hdr0").setAttribute("sortOrder","1");
document.getElementById("hdr1").setAttribute("sortOrder","0");
//document.getElementById("hdr0").innerHTML += "";
//document.getElementById("hdr1").innerHTML += "";
}
</script>
</head>
<body onload="changeSortOrder()">
<table class="SearchCustomerResults">
<thead><tr>
<th sortOrder="0" id="hdr0">red</th>
<th sortOrder="1" id="hdr1">blue</th>
</tr></thead>
</table>
</body>
</html>
innerHTML
を変更する行は、このバグを回避するように見えます。しかし、Googleでの参照は見つかりません。
申し訳ありませんが、私はIE7を使用していました。問題はまだ残っていますが、 – erikkallen