bootstrap 4 modal-backdrop style (specific modal)

You can add a custom class to the body before the modal is opened, and then remove the class when it's closed...

$('#exampleModal').on('show.bs.modal', function (e) {
    $('body').addClass("example-open");
}).on('hide.bs.modal', function (e) {
    $('body').removeClass("example-open");
})

The you just need the CSS for the custom color applied to the backdrop.

.example-open .modal-backdrop {background-color:red;}

https://www.codeply.com/go/oNKsVikW6n


Use div modal-content instead of modal-backdrop, like this :

$(".modal-content").css('background', 'red');

UPDATE :

Add in your css :

.modal-backdrop.show{background-color: red;}