Show JavaScript Confirmation Message in Red Color

Last Reply one year ago By pandeyism

Posted one year ago

how to show confirmation message in red colour using javascript

Posted one year ago
Hi @amar,
Please try the following

Show JavaScript Alert Message when using AJAX UpdatePanel in ASP.Net

It might help you.

Cheers Andrea.

Posted one year ago
You may try this code to solve your issue:

<head> <meta charset="utf-8" /> <title>JavaScript String fontcolor() Method</title> <link rel="stylesheet" href=" ui.css" /> <script src=""></script> <script src=""></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <script> $(function() { $( "#dialog-message" ).dialog({ modal: true, buttons: { Ok: function() { $( this ).dialog( "close" ); } }}); }); </script> </head> <body> <div id="dialog-message" title="My Dialog Alternative"> <p style='color:red'> Hello world </p> </div> </body> </html>

Posted one year ago

Hey amar,

You can't do anything with the alert/confirm boxes. If you need to style them then you need to use jQuery Modal dialog.

Please refer below sample.


<script type="text/javascript" src=""></script>
<script src="" type="text/javascript"></script>
<link href=""
    rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {
            buttons: {
                No: function () {
                Yes: function () {
    function Click() {
        alert("button is clicked.");
<div id="dialog" style="display: none; color: red" title="Confirmation Message">
    Did You want to close.
<input type="button" id="Button1" value="Button" style="display: none" onclick="Click();" />