Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
audio files overlapping.
Mohith Kovela
7y
331
1
Reply
<!DOCTYPE html>
<html>
<head>
<meta charset=
"utf-8"
/>
<title>RailwayAnnouncement</title>
</head>
<body>
<input id=
"TrainNumber"
type=
"text"
/>
<input id=
"Submit"
type=
"button"
value=
"Submit"
onclick=
"submit();"
/>
</body>
</html>
<script>
function submit() {
var TrainNumber = document.getElementById(
"TrainNumber"
).value;
var length = TrainNumber.length;
for
(var counter = 0; counter <= length - 1; counter++)
{
var trackNumber = TrainNumber[counter];
var audio =
new
Audio(trackNumber+
'.mp3'
);
audio.play();
}
}
</script>
Here is what I did. Audio files are overlapping. But I want them to play one after another. Help me with suggestions.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Interview questions of HTML5
Html input file default button(choose file) color change..?