IE、Chrome、FFで動作するように古いスクリプトを調整しています。私はそれをIEとChromeで動作させましたが、Firefoxはスタイルシートに変更を適用しないように見えます - 見えないスタイルを取得するアイテムは消えません。FirefoxでプログラムでCSSを更新する
次のコードは、可視性を変更するために使用されるようになりました:
<head>
<meta http-equiv='X-UA-Compatible' content='IE=10'>
<title>BootWiz.log.html</title>
<style type='text/css'>
h4 {
display: none;
font-size: smaller;
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
color: Green;
}
h3 {
display: none;
font-size: smaller;
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
color: Blue;
}
h2 {
display: block;
font-size: smaller;
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
color: #7030A0;
background-color: #EBEBEB
}
h1 {
display: block;
font-size: smaller;
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
color: Red;
background-color: #EBEBEB
}
.nav {
position: fixed;
width: 100%;
left: 0;
top: 0;
z-index: 100;
border-top: 0;
background-color: #FFFFFF
}
.cont {
position: relative;
top: 30
}
.success {
color: #ffff00;
background-color: #00cc00
}
.failure {
color: #ffffff;
background-color: #ff0000
}
</style>
<script type='text/javascript'>
var searchDone = false;
function ChangeVisibility(index, node) {
if (searchDone) {
alert('Need to reload the page.');
window.location.reload(true);
}
if (node.checked) {
document.styleSheets[0].rules[index].style.setProperty('display', 'block');
} else {
document.styleSheets[0].rules[index].style.setProperty('display', 'none');
}
}
function Search() {
.....
}
</script>
</head>
<body>
<div class="nav">
<center>
<input type='checkbox' onClick='ChangeVisibility(0, this);' />
<font style='color:Green'>Show Verbose</font>
<input type='checkbox' onClick='ChangeVisibility(1, this);' />
<font style='color:Blue'>Show Info</font>
<input type='checkbox' checked='checked' onClick='ChangeVisibility(2, this);' />
<font style='color: #7030A0'>Show Warning</font>
<input type='checkbox' checked='checked' onClick='ChangeVisibility(3, this);' />
<font style='color: Red'>Show Error</font>
<input id='search' /><button onclick='Search();'>Search Text</button>
</center>
<hr />
</div>
<div class="cont">
<font id='logContents' face='Verdana' size='3'>
<h2> 2015-08-25 08:27:43 <a class=success>Some Stuff started</a></h2>
廃止予定のHTMLタグ( '