Tryit<!DOCTYPE html><html><head><title>Wikitechy HTML onplaying attribute</title></head><body><h1>Wikitechy HTML onplaying attribute</h1><audiocontrolsonplaying=”myFunction()”><sourcesrc=”welcome.wav”type="audio/wav"><sourcesrc=”welcome.mp3”type="audio/mp3"></audio><script>functionmyFunction()
{
alert(“The Wikitechy audio have started playing”);
}
</script></body></html>
Code Explanation for onplaying Attribute in HTML:
The onplaying attributes is used to run “onPlaying()” function when the audio file is being played.
The <source> tag is used to give the location of the audio files
The function onPlaying() is used to display the alert message as “The Wikitechy audio have started playing!”
Output for onplaying Attribute in HTML:
If user play the audio file, the alert box will appear on the screen.