試圖打開網站的html文件。以下onclick在Internet Explorer中不起作用,但它適用於谷歌瀏覽器和Firefox。有什麼建議麼?html輸入類型按鈕在Internet Explorer中不工作
<tr id=tr1>
<td><input id=But1 style="background:url('butc.jpg')" value="Home" onclick="window.location.href='main.html'" type="button"></td>
<td><input type="button" id=But1 style="background:url('buto.jpg')" value="Advertise with us" onclick="window.location.href='advertise.html'" ></td>
<td><input id="But1" style="background:url('buto.jpg')" value="Become a marketer" onclick="window.location.href='market.html'" type="button"></td>
<td><input id="But1" style="background:url('buto.jpg')" value="BudBuddies" onclick="window.location.href='buds.html'" type="button"></td>
<td><input id="But1" style="background:url('buto.jpg')" value="BudTube" onclick="window.location.href='tube.html'" type="button"></td>
<td><input id="But1" style="background:url('buto.jpg')" value="Laws" onclick="window.location.href='laws.html'" type="button"></td>
</tr>
我是2天成HTML自學,並儘可能爲什麼我做事情的方式即時通訊做他們很好的真相是我不知道在這一點上做IM。我試圖做的是打開一個HTML文件在同一個窗口上點擊一個按鈕,這是工作正常在Firefox和鉻,但是當我打開它在Internet Explorer 8和9它不工作,所以任何建議什麼我做錯了非常感謝。我打開的所有html文件都是本地的。
什麼不工作,你得到的錯誤? – Gabe
哪個IE是?它適用於我的IE9。 http://jsfiddle.net/GolezTrol/x4LvR/ – GolezTrol
爲什麼你有六個按鈕都有相同的'id = But1'?一個'id'只能在頁面上存在一次。 –