How can I use a carriage return in a HTML tooltip?

前端 未结 27 1340
说谎
说谎 2020-11-22 11:59

I\'m currently adding verbose tooltips to our site, and I\'d like (without having to resort to a whizz-bang jQuery plugin, I know there are many!) to use carriage returns to

27条回答
  •  忘了有多久
    2020-11-22 12:27

    Just use JavaScript. Then compatible with most and older browsers. Use the escape sequence \n for newline.

       document.getElementById("ElementID").title = 'First Line text \n Second line text'
    

提交回复
热议问题