{"version":"1.0","type":"rich","title":"JS function to change links like <a href=\"something.wav\">sound</a> so that they play when clicked","description":"This example shows a JavaScript function that converts links to .wav audio files on a page into click-to-play controls, so users can listen without leaving the page or losing the link’s context. The code selects all anchor elements whose `href` ends with `wav` using `document.querySelectorAll`, then creates a new `Audio` object for each link and assigns the link’s URL as the audio source. It attaches a `click` event listener that prevents the default navigation behavior and calls `audio.play()` to start playback. The approach uses the native Web Audio API and DOM event handling, with no external libraries.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-9646534?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}