Playing sound with JavaScript

前端 未结 3 2033
-上瘾入骨i
-上瘾入骨i 2020-12-03 20:38

Doesn\'t matter what I do, I simply can\'t get this to play a sound in Firefox or IE, or Chrome for that matter.





        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 20:55

    FYI using the tag will invalidate your code. At the moment you have two choices if you want to play sounds on your web page: [1] use the method which works on most browsers today, but which will invalidate your HTML (using ), or [2] use the methods which will only work in some of the latest browsers, but which will be the way to go in the future and also is considered valid HTML (using or ).

    提交回复
    热议问题