audio = document.querySelector('audio');" /> audio = document.querySelector('audio');" /> audio = document.querySelector('audio');"/>

Multiple audio elements versus document.querySelector('audio');

27 Views Asked by At

I used css+javascript to customise the style of an audio element (audio tag).

<script type="text/javascript">
  audio = document.querySelector('audio');
  etc...

This searches and returns only the first 'audio' element in the html (good).

Now I want to show the audio element multiple times in the same page, with a few styling variations and different mp3s.

How to modify the 'element' name, or id, of each audio element (which is by default 'audio' for all of them) so that I can then call each of them individually?

0

There are 0 best solutions below