Alert not working


Topic: Alert not working

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


Krzysztof Wilk staff answered 4 years ago

Hi!

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

Best regards


Ok, thanks.

Will do that.


Mikołaj Smoleński staff commented 4 years ago

Did that solve the problem? Best regards


joelgrondrup commented 4 years ago

Yes. Thanks......


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue
  • User: 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
Tags