Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Sweetalert

<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>swal("My title", "My description", "success");</script>
Comment

sweet alert example

swal({
  title: "Good job!",
  text: "You clicked the button!",
  icon: "success",
  button: "Aww yiss!",
});
Comment

sweetalert

Swal.fire({
  position: 'top-end',
  icon: 'success',
  title: 'Your work has been saved',
  showConfirmButton: false,
  timer: 1500
})
Comment

sweetalert example

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

//Alert
<script>swal("My title", "My description", "success");</script>
Comment

sweetalert

Swal.fire({
  position: 'top-end',
  icon: 'success',
  title: 'Your work has been saved',
  showConfirmButton: false,
  timer: 1500
})
Comment

SweetAlert

Swal.fire({
  title: 'هل تريد الاستمرار؟',
  icon: 'question',
  iconHtml: '؟',
  confirmButtonText: 'نعم',
  cancelButtonText: 'لا',
  showCancelButton: true,
  showCloseButton: true
})
Comment

sweetalert

Swal.fire({
  title: 'Custom animation with Animate.css',
  showClass: {
    popup: 'animate__animated animate__fadeInDown'
  },
  hideClass: {
    popup: 'animate__animated animate__fadeOutUp'
  }
})
Comment

sweetalert

swal("Good job!", "success");
Comment

sweetalert

Swal.fire({
  imageUrl: 'https://placeholder.pics/svg/300x1500',
  imageHeight: 100,
  imageAlt: 'A tall image'
})
Comment

sweetalert

swal("Good job!", "You clicked the button!", "error");
Comment

sweetalert

swal("Good job!", "You clicked the button!", "success");
Comment

sweetalert

swal({  icon: "success",});
Comment

sweetalert

// reactjs codeto browse and upload an image from your device  
const addImage =async() => {

    const { value: file } = await Swal.fire({
      title: 'Select image',
      input: 'file',
      inputAttributes: {
        'accept': 'image/*',
        'aria-label': 'Upload your profile picture'
      }
    })
    
    if (file) {
      const reader = new FileReader()
      reader.onload = (e) => {
        Swal.fire({
          title: 'Your uploaded picture',
          imageUrl: e.target.result,
          imageAlt: 'The uploaded picture'
        }
        
        )
        console.log(e.target.result);
      }
     
      reader.readAsDataURL(file)
    }
    
Comment

sweet alert example

swal("Here's a message!")
Comment

sweetalert

<script src="//cdn.jsdelivr.net/npm/sweetalert2@10"></script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: p5js left mouse click 
Javascript :: javascript objectentries 
Javascript :: how to use if else inside jsx in react 
Javascript :: discord.js ban user 
Javascript :: moment clone 
Javascript :: break in map javascript 
Javascript :: how to trigger image upload button in from another button react js 
Javascript :: find max number in java 
Javascript :: get selected text 
Javascript :: embedded javascript 
Javascript :: rect to rect collision 
Javascript :: How to pass setInterval() into a Javascript class method 
Javascript :: react router v6 lazy suspense 
Javascript :: string.fromcharcode 
Javascript :: react bootstrap table 
Javascript :: javascript wrap object in array 
Javascript :: js stringify 
Javascript :: supertest express check response 
Javascript :: change build directory react 
Javascript :: ajax get request parameters 
Javascript :: csrf javascript 
Javascript :: timestamp to unix time react 
Javascript :: angular retry interceptor 
Javascript :: check if div contains background image 
Javascript :: Scaling an image to fit on canvas 
Javascript :: javascript replace ios apostrophe 
Javascript :: js download file from webserver 
Javascript :: react useEffect prevent first time 
Javascript :: reddit fetch api js 
Javascript :: javascript iterate over map values 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =