It’s not possible to do directly in JavaScript. You’ll need to embed a short WAV file in the HTML, and then play that via code.
An Example:
<script> function PlaySound(soundObj) { var sound = document.getElementById(soundObj); sound.Play(); } </script> <embed src="success.wav" autostart="false" width="0" height="0" id="sound1" enablejavascript="true">
You would then call it from JavaScript code as such:
PlaySound("sound1");
This should do exactly what you want – you’ll just need to find/create the beep sound yourself, which should be trivial.
Related Posts:
- Is it possible to sandbox JavaScript running in the browser?
- Onclick javascript to make browser go back to previous page?
- How to get the browser to navigate to URL in JavaScript
- Difference between mimetypes: audio/mpeg and audio/x-mpeg
- How can I play sound in Java?
- Playing mp3 song on python
- compressed and uncompressed .wav files
- Why doesn’t JavaScript support multithreading?
- How to add a new audio (not mixing) into a video using ffmpeg?
- What is the best way to profile javascript execution?
- How to get scrollbar position with Javascript?
- How can I stop the browser back button using JavaScript?
- How do I hide javascript code in a webpage?
- WordPress website broken in Facebook mobile browser
- Making audio playlist with external audio files?
- How to get the number of times an audio file has been played
- Download button for wp audio player
- How to remove hardcoded characters from playlists?
- Is it possible to control the width of the WordPress audio player?
- WP REST – video and audio players
- How to add audio files to wordpress blog and making it auto play?
- Background audio player
- How to make WordPress audio playlist understand the direct links of audio files shared on google drive?
- Removing Theme Audio Player – Using Browser Default
- Audio preloading
- Adding a download link to native WordPress playlist
- WordPress audio player causing js error, mediaelementplayer is not a function
- Using track metadata from audio shortcode
- Is ‘preload=”none”‘ a valid parameter in the [audio] shortcode in WordPress 3.6?
- wp_audio_shortcode shows player and url [closed]
- Starting from what version WordPress provides own embedded audio player without need a plugin?
- WordPress Audio tag problem in Chrome
- Load MediaPlayerElement after Infinity Scroll loads more posts
- Change audio player style
- How to get the number of times an audio file has been played
- Trim Audio Files [closed]
- Convert mp3 into ogg?
- Is the .flac audio file format supported by WordPress?
- audio link produces black box
- Need to hide/remove volume bar in WordPress Default Player to give more room to progress bar
- Problem adding MP3 attachments to a jPlayer playlist
- Clicking “Download MP3” downloads 0kb file
- Show audio player only in specific post type
- Trying to get the number of times an audio file has been played
- How to disable theme’s player styles so I could use plugin player?
- WP audio playlist width
- WordPress default audio playlist – how to add custom caption?
- How to restore deleted audio files from media library
- WordPress Audio Player
- Number of times an audio file has been played using custom player
- Trying to turn all of my posts into a soundcloud playlist and can’t figure out where to start
- Open template file in Pop Up
- Media Playlist Plugin
- MediaElement audio tag not visible
- WordPress audio link not working
- How to disable “Audio Player” to show up on the main page
- How to remove audio player styles added by mediaelement.js JavaScript?
- how to switch out music file for another using php echo
- How can I generate a rainbow circle using HTML5 canvas?
- What’s the difference between “{}” and “[]” while declaring a JavaScript array?
- How to convert decimal to hexadecimal in JavaScript
- What does “javascript:void(0)” mean?
- For-each over an array in JavaScript
- How to delete a cookie?
- What is a MIME type?
- What is TypeScript and why would I use it in place of JavaScript? [closed]
- How do you use the ? : (conditional) operator in JavaScript?
- How do you use the ? : (conditional) operator in JavaScript?
- Which equals operator (== vs ===) should be used in JavaScript comparisons?
- Generate unique random numbers between 1 and 100
- are there dictionaries in javascript like python?
- How can I convert MP3 file to a Base64 encoded string? [closed]
- How to do associative array/hashing in JavaScript
- How to append something to an array?
- How to format a JavaScript date
- How to make a discord bot create an invite for every server it joins?
- How to prevent the “Confirm Form Resubmission” dialog?
- ES6 Map in Typescript
- addEventListener vs onclick
- Sorting an array of objects by property values
- What is the JavaScript version of sleep()?
- “Uncaught SyntaxError: Cannot use import statement outside a module” when importing ECMAScript 6
- How to re-enable right click so that I can inspect HTML elements in Chrome?
- How do I check if an array includes a value in JavaScript?
- JavaScript document.getElementById().value logs empty value
- How do I color a hexagonal grid such that it doesn’t have neighbors of the same color?
- How to format a JavaScript date
- enabling right click:
- What does href expression do?
- map function for objects (instead of arrays)
- JavaScript sleep/wait before continuing [duplicate]
- Wait 5 seconds before executing next line
- Failed to load resource: the server responded with a status of 404 (Not Found)
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- How to check whether a string contains a substring in JavaScript?
- Random gradient background color
- Check if a string has a certain piece of text [duplicate]
- Parse JSON in JavaScript? [duplicate]
- Kadane’s algorithm explained
- What is console.log?