joelgrondrup free asked 3 years ago

Hi guys.

I've added a div with this code:

<div class="alert fade show mt-3" id="placement-example" data-position="top-right" data-hidden="true" data-width="25%" role="alert" data-color="primary"> Show me wherever you want! </div>

And then I add this javascript:

<a class="btn btn-primary btn-lg"
  onclick="mdb.Alert.getInstance(document.getElementById('placement-example')).show();" role="button">Click me to show alert</a>

But it's not showing the alert.

What am I doing wrong?

joelgrondrup free answered 3 years ago

Ok, thanks.

Will do that.

Mikołaj Smoleński staff commented 3 years ago

Did that solve the problem? Best regards

joelgrondrup free commented 3 years ago

Yes. Thanks......

Krzysztof Wilk staff answered 3 years ago


Just remove the .show class from your toast. Thanks for reporting this issue - that's a typo in our documentation :)

Best regards

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: 2.0.0
  • Device: Macbook
  • Browser: Chrome
  • OS: Mac OS 10.15.7
  • Provided sample code: No
  • Provided link: No