Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
Alert when mouse is hovering over text (HTML/Javascript

So I am writing a code that displays an alert box whenever the mouse hovers over a piece of text in HTML. The problem that I have is it is not working and I am not sure why. I tried finding help online but none of them worked. I need something that doesn't use JQuery for this assignment. What I have tried is to use function when activated with the mouse over event handler but that also didn't work.

This is my code:

        function mouseOver(){
            showAlert();
        }

        function showAlert(){
            alert("Alert!");
        }

This is another method that I have tried:

        function mouseOver(){
            document.getElementById("text").alert("Alert!");
        }
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try this

   function mouseOver(){
              alert("Alert!");
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use this

document.getElementById("text").addEventListener("mouseover", function( event ) {
  alert("Alert!");
}, false);
<p id="text">Hover Me</p>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda