bootbox icon indicating copy to clipboard operation
bootbox copied to clipboard

Add custom attributes for dialog buttons

Open ucscode opened this issue 3 weeks ago • 1 comments

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.

ucscode avatar Dec 10 '25 01:12 ucscode