Apply CSS to jQuery Dialog Buttons

前端 未结 10 2154
攒了一身酷
攒了一身酷 2020-12-01 01:02

So I currently have a jQuery dialog with two buttons: Save and Close. I create the dialog using the code below:

$dialogDiv.dialog({
    autoOpen: false,
             


        
10条回答
  •  心在旅途
    2020-12-01 01:47

    Select the div which has role dialog then get the appropriate buttons in it and set the CSS.

    $("div[role=dialog] button:contains('Save')").css("color", "green");
    $("div[role=dialog] button:contains('Cancel')").css("color", "red"); 
    

提交回复
热议问题