I have one text box which get multiple email id from user. And showing it in tooltip but i need to show each email (seperated by comma) on new line.
For that, need to detect comma & add new line character to it.
HTML is
<input type="text" id="email"> <div id="ttip"></div>
jquery for tooltip
$("#email").keyup(showTooltip);
var showTooltip = function(e) {
var tooltip = $(this).val();
if (tooltip == '') {
hideTooltip();
} else if (e.which == 188) {
tooltip += "<br>";
$("#ttip").fadeIn().html(tooltip);
} else {
$("#ttip").fadeIn().html(tooltip);
}
}
So when my tooltip is displaying in div it didn’t detect <br> and it is showing on same line.
How can I fix it?
Try: