Change Alert class

I’m trying to change the CssClass of an Alert when clicking on a button of the alert.

buttons: [
        {
          text: this.languageData.BUTTONS.CANCEL,
          handler: data => {
          }
        },
        {
          text: this.languageData.BUTTONS.LOGIN,
          handler: data => {
            if(data){
              if(...){     
                  this.setDeveloperData();
              }else{
                this.loginPrompt.setCssClass('LoginError');
                return false;
              }
            }
          }
        }
      ]

If i try it like that, its not working for me.
I’ve set another css class before adding the buttons, And i would like both css classes to be active.
Any help is appreciated!