Skip to content
Home » Web » jQuery » jQuery Tooltip HTML Codes

jQuery Tooltip HTML Codes

The default way to populate string in jQuery Tooltip is to treat all strings in title as plain text. If you want it accept HTML tags, here is an code snippet to do it.

$(document).tooltip({
  position : {
    my : "center bottom-20",
    at : "center top",
    using : function(position, feedback) {
      $(this).css(position);
      $("<div>").addClass("arrow").addClass(feedback.vertical).addClass(feedback.horizontal).appendTo(this);
    }
  },
    content: function () {
    return $(this).prop('title');
  },
});

Leave a Reply

Your email address will not be published. Required fields are marked *