我需要在我的脚本中添加“嘟嘟声”。每次需要发出声音时,我都会添加。
$("#beep").html("<embed src='button-16.wav' hidden='true' autostart='true' loop='false' id='bp' />")
但是当我添加了,后,我的焦点丢失了。
我尝试通过以下方式重新聚焦:
1)
$("#beep").html("<embed src='button-16.wav' hidden='true' autostart='true' loop='false' id='bp' />");
$("#txt").focus();
2)
$("#beep").html("<embed src='button-16.wav' hidden='true' autostart='true' loop='false' id='bp' />");
$("#bp").ready(function(){
$("#txt").focus();
});
但是第一种和第二种方式都不起作用。
HTML代码。
<div id="beep"></div>
<input type="text" id="txt" />
所以,如何在蜂鸣声后保存文本框的焦点?
<audio>
标签来... - ThiefMaster