You can add a div
to your message, like this:
bootbox.dialog("Your message <div id='SecondsRemaining'>10</div>");
Then update it using this function:
(function(){
var remaining = 10; // Number of seconds
var obj = document.getElementById("SecondsRemaining");
var timeout = window.setInterval(function(){
remaining--;
if(remaining==0) {
// Time is up, stop the timer and hide the bootbox
window.clearInterval(timeout);
bootbox.hideAll();
return;
}
obj.innerHTML = remaining; // Update the value displayed
}, 1000); // Decrease counter every second
})();
For bootbox 4+ the format has changed. The dialog should be created:
bootbox.dialog({ message: "Your message <div id='SecondsRemaining'>10</div>" });