Javascript control another javascript

Hello, can stop javascript with another javascript ?

<script type="text/javascript">
				function test<?php echo $row["id"] ?>(){
		
					var sound = new Audio("<?php echo $play ?>");
					sound.onended = function () {
						document.getElementById("myCheck").click();
						}
					sound.play();		
			};
			</script>

i get from every script diferent name test+id.
Can i stop previus script, or can i stop all sound’s, beacose on click again i have socond sound and again click have 3,4,5,6… sounds in one time :frowning:

A continuation of your previous sound question?

Well, You need to create a list of all possible MP3’s and have the play function stop all of them before it plays the new one. To stop a sound or MP3, use this code…

sound.currentTime = 0;
sound.pause();

Not really sure how to show you an example… Try it…

Sponsor our Newsletter | Privacy Policy | Terms of Service