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

193
Vistas
How to change confirm button of Swal

I'm using Sweetalertjs and I have coded this for showing a popup message to users:

$(document).ready(function(){
            let popup_shown = false;
            let cookies = document.cookie.split('; ');
            for( let i=0; i<cookies.length; i++ ){
                cookie = cookies[i].split('=');
                if( cookie[0] == 'zxczxc' )
                    popup_shown = true;
            }
            if( !popup_shown ){
                    var popup_data = '{!! $output !!}'
                    Swal.fire({ html:popup_data });
                    document.cookie = "zxczxc=1; path=/";
            }
        });

And it works fine and perfect but I just need to know how to change the Cofirm button text which is by default set to Ok.

So I've searched and they said I can do this via this:

        swal({
            confirmButtonText: 'Yes, I am sure!',
        },

But this is wrong since I'm showing the popup by using Swal.fire.

So how can I change the confrim button text in this case?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Swal.fire({
  title: '<strong>HTML <u>example</u></strong>',
  icon: 'info',
  html:
    'You can use <b>bold text</b>, ' +
    '<a href="//sweetalert2.github.io">links</a> ' +
    'and other HTML tags',
  showCloseButton: true,
  showCancelButton: true,
  focusConfirm: false,
  confirmButtonText:
    '<i class="fa fa-thumbs-up"></i> Great!',
  confirmButtonAriaLabel: 'Thumbs up, great!',
  cancelButtonText:
    '<i class="fa fa-thumbs-down"></i>',
  cancelButtonAriaLabel: 'Thumbs down'
})

please check it is explained on their official github page https://sweetalert2.github.io/

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