When I click on the "Active account" button inside the designated td
with the <tr id="tr_color" >
, I want the value "1" to be added to the 'active_account' column in the database. I have been successful with this functionality. However, I am facing an issue where the background color of the td
is not changing to blue as expected.
JavaScript
<script type="text/javascript">
function active_user_account() {
jQuery.ajax({
url: "check_data.php",
data:'conf_data='+ document.getElementById( "active_account" ).value + '&id='+ document.getElementById( "id_this_user" ).value,
type: "POST",
success:function(data){
document.getElementById("tr_color").style.backgroundColor = "blue !important";
},
error:function (){}
});
}
</script>