Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
Cómo cambiar el botón de confirmación de Swal

Estoy usando Sweetalertjs y he codificado esto para mostrar un mensaje emergente a los usuarios:

 $(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=/"; } });

Y funciona bien y perfecto, pero solo necesito saber cómo cambiar el texto del botón Confirmar, que está configurado de forma predeterminada en Ok .

Así que he buscado y me dijeron que puedo hacer esto a través de esto:

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

Pero esto está mal ya que estoy mostrando la ventana emergente usando Swal.fire .

Entonces, ¿cómo puedo cambiar el texto del botón de confirmación en este caso?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

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' })

compruebe que se explica en su página oficial de github https://sweetalert2.github.io/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!