+ 2

how to play music on hover a image ?

i have a task to create the music will be play when i hover a image, please help

14th Dec 2019, 6:35 AM
RianLauo
RianLauo - avatar
1 Réponse
+ 5
var audio = new Audio('audio_file.mp3'); document.querySelector(".img1"). addEventListener ("mouseOver", function() { audio.play(); });
14th Dec 2019, 7:59 AM
Calviղ
Calviղ - avatar