0
夥計!我的問題是這個代碼對IE 8的優化(IE 8的第一個按鈕是好的,但第二個不起作用),谷歌瀏覽器(第二個按鈕是好的,但首先不工作)。我已經堆疊起來了,請幫忙。 :)網站頁面按鈕優化問題
第一個按鈕
<div id="spoiler">
<div>
<p style="text-align: center;"><input style="margin: 10px; padding: 0px; width: 150px; font-size: 12px; background-color: #fdeaa8;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'hide spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = Show again?'; }" type="button" value="Elaya company" /></p>
<div>
<div id="show" style="border-style: solid; border-width: 1px; margin: 0px; padding: 4px; display: none; background-color: transparent; width: 98%;">
</div>
第二個按鈕
<div id="spoiler">
<div>
<p style="text-align: center;"><input style="margin: 10px; padding: 0px; width: 150px; font-size: 12px; background-color: #fdeaa8;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show again?'; }" type="button" value="AssolModa company" /></p>
<div id="show" style="border-style: solid; border-width: 1px; margin: 0px; padding: 4px; display: none; background-color: transparent; width: 98%;">