- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML5 audio control stop button
Try the following code to add a stop button to your audio in HTML5:
function displayStopBtn() { var myPlayer = document.getElementsByTagName('audio')[0]; myPlayer.pause(); myPlayer.currentTime = 0; }
You can also include jQuery:
$("#stopButton").click(function () { audio.pause(); audio.currentTime = 0; });
Advertisements