How to create an SVG "tooltip"-like box?

morais picture morais · Sep 19, 2008 · Viewed 63.5k times · Source

Given an existing valid SVG document, what's the best way to create "informational popups", so that when you hover or click on certain elements (let's say ) you popup a box with an arbitrary amount (i.e. not just a single line tooltip) of extra information?

This should display correctly at least in Firefox and be invisible if the image was rasterized to a bitmap format.

Answer

Neil Fraser picture Neil Fraser · Oct 16, 2012

This question was asked in 2008. SVG has improved rapidly in the intervening four years. Now tooltips are fully supported in all platforms I'm aware of. Use a <title> tag (not an attribute) and you will get a native tooltip.

Here are the docs: https://developer.mozilla.org/en-US/docs/SVG/Element/title