None of these makes the title appear with a new line.
ele.title = 'abc ABC';
ele.setAttribute('title', 'abc ABC');
If i load the page with that element having the same title, then it would be with a new line. I've even tried with different new line markings.
None of these makes the title appear with a new line.
ele.title = 'abc ABC';
ele.setAttribute('title', 'abc ABC');
If i load the page with that element having the same title, then it would be with a new line. I've even tried with different new line markings.
\n
. Although the title element probably won't allow any linebreaks.
– zer00ne
Commented
Jan 6, 2017 at 19:07
This works for me
ele.title = 'abc' + "\u000d" + 'ABC';
This is the Unicode escape sequence for the carriage return (CR). I am not sure why HTML entity names or numbers do not work in the title, but the Unicode escape sequence is what works.