bootbox
bootbox copied to clipboard
Add custom attributes for dialog buttons
bootbox.dialog({
message: '<p>This dialog demonstrates many of the options available when using the Bootbox library</p>',
..., // other options
buttons: {
myButton: {
label: 'Fee',
className: 'btn-primary',
// allow custom attributes
attrs: {
"data-value": "my custom value",
"data-trigger": "#some-custom-trigger",
},
callback: function () {
//
},
},
}
});
<div class="modal-dialog">
...
<button class="btn btn-primary" data-value="my custom value" data-trigger="#some-custom-trigger">Fee</button>
</div>
Allow users to set custom attribute on the buttons declared in dialog box.