Muthu
Muthu

Reputation: 357

Title Attribute not working in Firefox Addon

I am developing a mozilla firefox addon. I need a hover tooltip for a icon in my panel of firefox extension. When i use the title attribute the tooltip is not displaying. Suggest me a solution .

P.S : I am specifiying about the firefox addon or extension , not the browser

Thanks in Advance

Upvotes: 0

Views: 723

Answers (1)

Luckyrat
Luckyrat

Reputation: 1455

Normally you just need to do this:

myElement = document.createElement("someXULtagName");
myElement.setAttribute("tooltiptext","My tooltip text");

But inside panels (at least non-SDK ones) you have to do more work if you are including HTML elements instead of XUL elements:

myPanelview = document.createElement('panelview');
myPanelview.setAttribute('tooltip', 'aHTMLTooltip');
...
myElement = document.createElementNS('http://www.w3.org/1999/xhtml', "someHTMLtagName");
myElement.setAttribute("title","My tooltip text");

Upvotes: 1

Related Questions