6

Possible Duplicate:
How can I use a carriage return in a HTML tooltip?

Currently if I want to insert a new line in title=, I would do this:

<span id="dummy" title="Hello
World!">Dummy</span>

Live demo: http://jsfiddle.net/DerekL/XFMfx/

But this looks really weird to me, and it just messes up my HTML file. Just imagine all those new lines in it.
So I'm wondering if there is a better way to achieve this, so that it won't mess it up.

Thanks.

Community
  • 1
  • 1
Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247

2 Answers2

5

This is not possible. There are no cross-browser solutions. If you want a line break in your title attribute, you'll have to use JavaScript.

animuson
  • 53,861
  • 28
  • 137
  • 147
3

As of Firefox 12 (which is the current Aurora version), this is (finally) supported. See the related bug.

skittleys
  • 353
  • 1
  • 3
  • 11