Joxmar Joxmar - 4 months ago 279
CSS Question

Add HTML markup to materialize.css tooltip

Is there a way to add HTML markup to the tooltip in materialize? I'm trying to arrange some data as definition list inside a tooltip. I tried to add it directly into the data-tooltip attribute but it doesn't seem to recognize the tags.

Answer

In materialize.js, around line 1258 make the following change to covert all tooltips to html.

// Change .text()
newTooltip.children('span').text(origin.attr('data-tooltip'));
// To .html()
newTooltip.children('span').html(origin.attr('data-tooltip'));