how to change background color and image of a toaster?

305 views Asked by At

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

There are 1 answers

0
Yaiza del Río On

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);
        }
    }