0

i want to change background color and image to else condition (toaster.error)

       success: function (data) {
                        if (data.message != ""){
                            toastr.success(data.message);
                        }
                        else {
                            toastr.error(data.message1);
                        }
                    }

this code i am using i want help in it

1 Answers1

0

You need to access that element with the DOM, maybe like this:

success: function (data) {
        if (data.message != ""){
            toastr.success(data.message);
            yourElementToChangeColor.classList.add('class-with-the-color')
        }else {
            toastr.error(data.message1);
        }
    }