Click here to Skip to main content
15,884,975 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a link button. when I click that button a new modal dialog will appear having a ok button. the button creation code is
JavaScript
function ShowMessageBox() {
           $("#messageBox").dialog({
               modal: true,
               buttons: {
                   Ok: function () {
                       $(this).dialog("close");
                   }
               }
           });
           return false;
       }


And now I want to change the color of that ok button to red. can you please help me.?
Thanks in advance.
Posted
Comments
José Amílcar Casimiro 26-May-15 10:25am    
It will not be better to make use of CSS?

1 solution

Try like below
C#
$(".ui-dialog-buttonpane button:contains('Ok')").attr('style','background-color:Red');

Hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900