How do I play a sound in web development when a button is clicked? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 4

How do I play a sound in web development when a button is clicked?

How do I play a sound in web development when a button is clicked and stop when clicked again? Pls comment the code

25th Jun 2023, 12:11 AM
Amartisan Negeri
Amartisan Negeri - avatar
4 Respuestas
+ 4
Ready-made codes are not the source of learning. Leeroy Mokua gave you a hint. Try to make it or else read the corresponding lessons
25th Jun 2023, 3:05 AM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 3
You can try writing a function that changes the html audio element attribute to auto play on the onclick event
25th Jun 2023, 12:16 AM
Leeroy Mokua
Leeroy Mokua - avatar
+ 3
Can u give me the code im new to web development
25th Jun 2023, 12:17 AM
Amartisan Negeri
Amartisan Negeri - avatar
+ 2
Learning JavaScript will give you the skills you need to make a sound play or stop whenever a button is clicked.
26th Jun 2023, 4:39 AM
Chris Coder
Chris Coder - avatar