The jQuery UI Dialog Dialog is a very flexible and powerful tool for this. Here is an example of how to ask a user if he wants to delete something:
<div id="dialog_box" style="display: none;"> Really delete? </div> <button class="delete_btn">Delete</button> <script> $('.delete_btn').click(function(){ $('#dialog_box').dialog({ title: 'Really delete this stuff?', width: 500, height: 200, modal: true, resizable: false, draggable: false, buttons: [{ text: 'Yep, delete it!', click: function(){ </script>
// EDIT:
From your initial question, it was not entirely clear that you did not want to use jQuery Dialog (but why mark the question with jquery / jquery-ui?).
AFAIK, there is no other way to accomplish what you want to do. Also, keep in mind that the native JavaScript dialog box text also takes care of the browser language and other local factors. Thus, it may not always be a good idea to deal with this.
source share