Search code examples
javascriptjqueryjquery-pluginsjquery-tools

JQuery Tools: How to populate title tag from another JS file text string


I am using JQuery Tools plugin for tooltip its working fine but I would like to load my text string for tool tip from another JS file or how to populate title tag from another JS file text string. Here is my code:

$(".show-tooltip-top[title]").tooltip({position: "top center"});

Previously I was doing like this with JQuery only not plugin:

$(".tooltip-test",this).html("This is a tooltip test");

Solution

  • It's not entirely clear what you're asking, but if you just want to know how to change the title attribute of an element, you can use jQuery's attr function:

    $(".show-tooltip-top[title]").attr("title", "your title text goes here").tooltip({position: "top center"});