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