Search code examples
jquerypluginsjquery-pluginstooltip

jQuery Tooltip that doesn't use the <title> attribute


I'm looking for a jQuery tooltip plugin that doesn't use the <title> attribute. I've tried a few variations so far including; Tooltipster, PowerTip, jTip and TipTip! They all work but don't all work properly in IE8 (this is a must). They also all use the <title> attribute.

I need to be able to use other <html> tags such as <p> etc within the containing block hence the need to not use <title>. A plugin that uses <div> or similar would be perfect as I can then customise to how I want and use the relevant <html> tags.

I've searched and searched and searched but can't find anything, so if anybody knows of one I would greatly appreciate it!


Solution

  • You can use the jQuery Tooltip without title using custom-content like:

    $(function () {
        var content = 'We ask for your age only for statistical purposes.';
        $(document).tooltip({
            items: "input",
            content: function () {
                var element = $(this);
                if (element.is("input")) {
                    return "<p class='arrow'>" + content + "</p>";
                }
            }
        });
    });
    

    FIDDLE DEMO