jQueryUI tooltip Widget to show tooltip on Click

Using jqueryui:

HTML:

<div id="tt" >Test</div>

JS:

$('#tt').on({
  "click": function() {
    $(this).tooltip({ items: "#tt", content: "Displaying on click"});
    $(this).tooltip("open");
  },
  "mouseout": function() {      
     $(this).tooltip("disable");   
  }
});

You can check it using
http://jsfiddle.net/adamovic/A44EB/

Thanks Piradian for helping improve the code.

Leave a Comment