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

281
Views
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 answers
Answer question

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 Report

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 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!