Alert not working


Topic: Alert not working

joelgrondrup pro premium asked 4 months 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?


Krzysztof Wilk staff answered 4 months ago

Hi!

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

Best regards


joelgrondrup pro premium answered 4 months ago

Ok, thanks.

Will do that.


Mikołaj Smoleński staff commented 4 months ago

Did that solve the problem? Best regards


joelgrondrup pro premium commented 4 months ago

Yes. Thanks......


Please insert min. 20 characters.
Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB 5
  • MDB Version: 2.0.0
  • Device: Macbook
  • Browser: Chrome
  • OS: Mac OS 10.15.7
  • Provided sample code: No
  • Provided link: No
Tags