skip to Main Content

Disable `audio` html tag

I have an html audio tag in my project, which in some situation I need to disable. In order to do it I apply the following css by adding disabled class to the audio tag: audio.disabled { pointer-events: none }…

VIEW QUESTION

Why I can't play audio automatically using html?

I'm trying to make web page in which there will be music playing in background. <!DOCTYPE html> <html lang="pl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Website </title> </head> <body> <h2>Welcome to my website</h2> <audio src="sound.mp3" controls autoplay> <p>If…

VIEW QUESTION
Back To Top
Search