Skip to content

Commit

Permalink
Added new sound in mouseover elements in HTML guide
Browse files Browse the repository at this point in the history
  • Loading branch information
argenisosorio committed May 29, 2024
1 parent f3423c0 commit d25fa24
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions html.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4790,3 +4790,38 @@ Fuente
======

ChatGPT

==============================================
Reproducir sonido mp3 con hover sibre span tag
==============================================

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reproducir Sonido al Hacer Hover</title>
<style>
#hover-span {
display: inline-block;
padding: 10px;
background-color: #f0f0f0;
border: 1px solid #ccc;
cursor: pointer;
}
</style>
</head>
<body>
<span id="hover-span">Pasa el mouse por aquí</span>

<audio id="hover-sound" src="click-sound.mp3"></audio>

<script>
document.getElementById('hover-span').addEventListener('mouseover', function() {
var audio = document.getElementById('hover-sound');
audio.play();
});
</script>
</body>
</html>

0 comments on commit d25fa24

Please sign in to comment.