Search code examples
htmltooltip

How to display huge amount of data a tooltip


I am displaying 400 account names in the tooltip of a span element.

<input type="button" value="AccountList" id="accountlist" title="[400 names here]" />

But it is displaying only a part of it, it is not displaying all 400 account names. How is this caused and how can I solve it?


Solution

  • You are hitting the browser's length limit on the title attribute. The limit depends on the browser. Microsoft (IE) publishes its limit as 512. I don't think we have the official published limits for the other browsers, but empirically it doesn't seem like a lot more than that.

    You can solve it by not relying on the browser's "tool tip", but build your own custom one using CSS. Look here for a simple tutorial.