DEV Community


Posted on

button audio

Good afternoon. I have a react app.
There are fifty audio buttons on the page.
Each button has its own small mp3 file.
I can't find the correct code to write such a page. Perhaps there are solutions. Share the link please)

Top comments (2)

aleksjy profile image

Thanks for your attention and reply.
How to import { new audio }
I still can't find a working solution.
There is a lot of code and complexity everywhere.
Image description
Image description

tanimu_maidoki profile image
Umar Maidoki • Edited

You can try the if else()

const music = new audio("https://usic.mp3")
if(music.paused) {
}else {
Enter fullscreen mode Exit fullscreen mode

Add this to onClick function

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git