NOTY is a jQuery plugin that makes it easy to create alert - success - error - warning - information - confirmation messages as an alternative the standard alert dialog. Each notification is added to a queue. (Optional)


Confirm Dialogs

We can set button objects with an array like above;

noty({
  text: 'Do you want to continue? <input id="example" type="text">',
  buttons: [
    {addClass: 'btn btn-primary', text: 'Ok', onClick: function($noty) {
        // this = button element
        // $noty = $noty element

        console.log($noty.$bar.find('input#example').val());

        $noty.close();
        noty({text: 'You clicked "Ok" button', type: 'success'});
      }
    },
    {addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {
        $noty.close();
        noty({text: 'You clicked "Cancel" button', type: 'error'});
      }
    }
  ]
});