Posts Tagged ‘jQueryUI tooltip HTML Title’

h1

jQueryUI tooltip HTML support

April 15, 2016

The latest version of jQueryUI tooltip is not supporting HTML tags.

we can override the original functionality to start support HTML

Method 1 : overrides the default behavior

$(function () {
      $(document).tooltip({
          content: function () {
              return $(this).prop('title');
          }
      });
  });

Example : http://jsfiddle.net/Aa5nK/12/

Method 2 : override the tooltip widget

$.widget("ui.tooltip", $.ui.tooltip, {
    options: {
        content: function () {
            return $(this).prop('title');
        }
    }
});

Example : http://jsfiddle.net/Aa5nK/14/

Reference : stackoverflow