How can I update the data-badge count on a Material Design Lite badge in javascript? For example, the count of new notifications on a notification badge after fetching the notifications from the database.
Found the solution in Javascript:
let element = document.getElementById("#yourBadgeId");
element.setAttribute("data-badge" , yourValue);
make sure that in the html script, the mdl badge tag should not contain the data-badge attribute