Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda