Search code examples
javascriptjqueryhtmltooltiptitle

Add style to data-original-title in jQuery attr


I want to make parts of the title bold and make it multiline. Is there anyways I can do that?

This is my current code:

$('.size .card-text').text(siFormat(size_avg).replace(/G/,'B')).attr('data-original-title', 
      "yoyoyo: " + Math.round(size_avg))

Currently the result is:

yoyoyo: 3.35

I want it to be:

yoyoyo:

3.35


Solution

  • Basically, there are choices for you to make, as mentioned in older post:

    style data-original-title

    I think in your case, you may use another attribute: data-html=true