Play sound file when image is clicked

前端 未结 3 581
-上瘾入骨i
-上瘾入骨i 2020-12-09 21:51

I am not a native HTML programmer, so please don\'t jump all over me about this simple question.

I have an image that, I am displaying using the followi

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 22:23

    First you have to use jQuery. You may create some

    in your page having some id, for example;

     
    .

    Then, in your JavaScript, when you want to play the file, just add

    $('#wrap').append('');
    

    the whole code looks something like;

    
    
    
    
     

    Hope this helps.

提交回复
热议问题