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
- Understanding React-Redux and mapStateToProps()
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- Send POST data using XMLHttpRequest
- querySelector vs. getElementById
- Google weather widget on my website
- How to generate a simple popup using jQuery
- How to reset a form using jQuery with .reset() method
- Uncaught ReferenceError: Firebase is not defined
- Javascript removeEventListener not working
- Load image with jQuery and append it to the DOM
- RGB to hex and hex to RGB
- No visible cause for “Unexpected token ILLEGAL”
- Understanding the ngRepeat ‘track by’ expression
- How can I test if a letter in a string is uppercase or lowercase using JavaScript?
- How to create a HTML Cancel button that redirects to a URL
- How to get the first element of an array?
- JavaScript: function returning an object
- What is the non-jQuery equivalent of ‘$(document).ready()’?
- HTML / Javascript in custom field textarea?
- How to replace a javascript select box onchange event to a form submit action?
- 3.5 media.editor: what is the event listener for choosing an image?
- javaScript in section of WP API
- Handling URLs in WordPress application
- How to Add Javascript Only When a Function Exists?
- TypeError: window.tinyMCE.execInstanceCommand is not a function
- event/callback on block update?
- how to add custom css and js on wordpress post editor directly without using .php file
- Twenty fifteen theme – change responsive menu condition
- Ajax load more button for comments wordpress
- Gutenberg consume wp-json data and reflect in frontend the content
- Create special WordPress slideshow with “jquery.cycle.all.js”
- url_to_postid returns 0
- random reason on refresh
- How to turn off automatic operation for Nivo Slider?
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- Removing admin javascript
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- How to make sure, that only the selected post is changing?
- Get URL of current featured image with JS in edit post view
- Adding Custom HTML/CSS/JS code in specific page
- Javascript as Jquery Function Call?