<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Audio test</title>
<script type="text/javascript">
// @param filename The name of the file WITHOUT ending
function playSound(filename){
document.getElementById("sound").innerHTML='<audio autoplay="autoplay"><source src="' + filename + '.mp3" type="audio/mpeg" /><source src="' + filename + '.ogg" type="audio/ogg" /><embed hidden="true" autostart="true" loop="false" src="' + filename +'.mp3" /></audio>';
}
</script>
</head>
<body>
<button onclick="playSound('bing');">Play</button>
<div id="sound"></div>
</body>
</html>
Next
« Prev Post
« Prev Post
Previous
Next Post »
Next Post »
0 Komentar untuk "Coding untuk menampilkan alert berserta bunyi alert dengan HTML + Javascript"
Silahkan berkomentar dengan bijak dan positif. Komentar anda menunjukkan sikap anda. Terima kasih :-)