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

283
Vistas
Button text not showing in SweetAlert

enter image description here

I don't really know what I am doing wrong here. SweetAlert work well, but not showing the button text.

swal({
    title: "Are you sure?",
    text: "Once deleted, you will not be able to recover this imaginary file!",
    icon: "warning",
    buttons: true,
    dangerMode: true,
});
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try to create a clean html page a try it out like this:

swal({
  title: "Are you sure?",
  text: "Once deleted, you will not be able to recover this imaginary file!",
  icon: "warning",
  buttons: true,
  dangerMode: true,
})
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

Probably the issue is with other scripts in your page as your code should work, instead you can try to use Sweetalert2 like this:

Swal.fire({
  title: 'Do you want to save the changes?',
  showCancelButton: true,
  confirmButtonText: 'CONFIRM',
  denyButtonText: `CANCEL`,
}).then((result) => {
  /* Read more about isConfirmed, isDenied below */
  if (result.isConfirmed) {
    // confirm button pressed
    console.log("confirm")
  } else if (result.isDismissed) {
    // deny button pressed
    console.log("deny")
  }
})
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.1.9/dist/sweetalert2.all.min.js"></script>

EDIT:

Try to add jquery in your HTML page before other script imports like this:

<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
about 4 years ago · Juan Pablo Isaza Denunciar

0

here is the answer

swal({
                title: "Are you sure?",
                text: "Once deleted, you will not be able to recover this imaginary file!",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: '#DD6B55',
                confirmButtonText: 'Yes',
                cancelButtonText: "No",
                closeOnConfirm: false,
                closeOnCancel: false
            },

Or

swal({
  text: "Once deleted, you will not be able to recover this imaginary file!",
  buttons: ["Yes", "No"],
});

or

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

swal("Are you sure you want to do this?", {
  buttons: ["Yes", "No"],
});
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