Is it possible to add html inside a title attribute?

前端 未结 8 1668
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 14:57

Is there a way to put actual html code inside a title attribute on a table row element? My goal is to pop-up not only text but some info-graphics along with it, so a mouseo

8条回答
  •  无人及你
    2020-11-30 15:29

    Native tooltips do not use HTML. jQuery UI tooltips would be very useful here.

    Demo: http://jqueryui.com/tooltip/

    EDIT: You would need to use the content option to use markup instead of the title attribute.

    $(".text")
        .tooltip({ content: 'Tooltip text' });
    

    Here's a Fiddle demonstrating this: http://jsfiddle.net/acbabis/64Q2m/

提交回复
热议问题