Jquery progress bar color change

jqueryjquery-plugins

This is my jquery progress bar i want to the change the color for the progress bar with class of Acceptedbar to green and class of Declinedbar to Red

  <head runat="server">
    <title>Idea Storm</title>
    <link href="css/CSS.css" rel="stylesheet" type="text/css" />

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js" type="text/javascript"></script>

    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"
        type="text/javascript"></script>

    <script src="script/ui.progressbar.js" type="text/javascript"></script>

    ‚Äč<style type="text/css">

.AcceptedBar > .ui-progressbar-value {
   background:green;
}

.DeclinedBar > .ui-progressbar-value {
   background: red;
}
</style>
    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css">
    <%-- <link href="App_Themes/HRIS-Theme/jquery.ui.core.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/HRIS-Theme/jquery.ui.theme.css" rel="stylesheet" type="text/css" />--%>
</head>

<script type="text/javascript">

    $(function () 
    {
           $('.Accepted').each(function()
            {            
                var valueFromHiddenField = $('input[type=hidden]', this).val();
             $('.Acceptedbar', this).progressbar({ value: valueFromHiddenField});
      });


    });
    $(function () 
    {
       $('.Declined').each(function() {
        // We assume that there is only 1 hidden field under 'pbcontainer'
        var valueFromHiddenField = $('input[type=hidden]', this).val();
       $('.Declinedbar', this).progressbar({ value: valueFromHiddenField });
        });
    });


</script>

Best Solution

You should use CSS to style your progress bars, details on theming here :

.AcceptedBar > .ui-progressbar-value {
   background: green;
}

.DeclinedBar > .ui-progressbar-value {
   background: red;
}

Working example here

You cannot use background-color as the themes set a background-image so you must use background