Consider this html button tag:
<button type="submit" name="perks_request_status" class="btn-flat disabled btn-small perks_request_status" id="perks_request_status" style="">{{ $perk->status }}</button>
with this following css definition (from the css framework that i am using)
.btn-flat.disabled, .btn-flat.btn-flat[disabled] {
cursor: default;
color: #b3b3b3 !important;
background-color: transparent !important;
}
How can i change/override its style using Javascript? I tried to define style of my id tag perks_request_status
using method below but no effect has been reflect.
function changeStatusColor(status, element){
switch(status){
case 'Approved':
element.style.color = '#00796b !important';
break;
case 'Drafted':
element.style.color = '#01579b !important';
break;
case 'Cancelled':
element.style.color = '#b71c1c !important';
break;
case 'Disapproved':
element.style.color = '#d50000 !important';
break;
}
}