標籤:style blog http color io java ar div 問題
在chrome下沒問題,ie(Win8,IE10), 只有第一次點擊的單詞才有發音,點擊其他的還是發第一次點擊的單詞
<html><head> <title></title> <script type="text/javascript"> function PlayWordEn(obj) { var text = obj.value; document.getElementById(‘test‘).innerHTML = ‘<source src="http://dict.youdao.com/dictvoice?audio=‘+text+‘&type=1" type="audio/mpeg">‘; document.getElementById(‘test‘).play(); } function PlayWordUs(obj) { var text = obj.value; document.getElementById(‘test‘).innerHTML = ‘<source src="http://dict.youdao.com/dictvoice?audio=‘+text+‘&type=2" type="audio/mpeg">‘; document.getElementById(‘test‘).play(); } </script></head><body><p><button type="button" onclick =‘PlayWordEn(this)‘ onmouseover=‘PlayWordEn(this)‘ value="one">one</button><button type="button" onclick =‘PlayWordEn(this)‘ onmouseover=‘PlayWordEn(this)‘ value="two">two</button></p> <video style="display:none;" controls="" id="test" name="media"> </video></body></html>
這段html代碼在ie下有問題。