I'm trying to break my custom HTML tooltip that I used inside the button Hover Button . I tried using different approach(ie., /n, 
) in typescript as it's a custom tooltip to add a line break and nothing seem to work.
Below is the tooltip data that I'm using and the fiddle associated with the same:
tooltipData="Helo,Angular 2" + "
" + "This button is used to test hover message" + "/n" + "This message should come at the last"
Try this -
<div title="Helo,Angular 2
This button is used to test hover message	This message should come at the last">Hover Me</div>
Here I used -

 - for New line
I Hope this will work for you.
You're using the wrong slash - new line should be \n not /n:
tooltipData="Helo,Angular 2" + "
" + "This button is used to test hover message" + "\n" + "This message should come at the last"
Update your fiddle to use \n
rather than /n
.
Hi this code will work in all browser !!i used for new line in chrome and safari and ul li for IE
function genarateMultiLIneCode(){
var =values["a","b","c"];
const liStart = '<li>';
const liEnd = '</li>';
const bullet = '• ';
var mergedString = ' ';
const unOrderListStart='<ul>'
const unOrderListEnd='</ul>'
const fakeNewline = '
';
for (let i = 0; i < values.length; i++) {
mergedString += liStart + bullet + values[i] + liEnd + fakeNewline;
}
const tempElement = document.createElement("div");
tempElement.innerHTML = unOrderListStart + mergedString + unOrderListEnd;
return tempElement.innerText;
}
}
var =values["RAHUL","BIKASH","RAMAN"];
const liStart = '<li>';
const liEnd = '</li>';
const bullet = '• ';
var mergedString = ' ';
const unOrderListStart='<ul>'
const unOrderListEnd='</ul>'
const fakeNewline = '
';
for (let i = 0; i < values.length; i++) {
mergedString += liStart + bullet + values[i] + liEnd + fakeNewline;
}
const tempElement = document.createElement("div");
tempElement.innerHTML = unOrderListStart + mergedString + unOrderListEnd;
then use tempElement.innerText
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.