Break text over multiple lines in bootable content

I am trying to add the text content of a bootstrap popover with multiple lines. I create a line with a possible line break, as shown below, I tried \n, \r\n, <br>, <br/> and <br /> , but all in vain.

  var files = 'No files selected'; if (path.length > 1) { files = ''; for (var i = 0; i < path.length - 1; i++) { files += path[i] + '<br />'; } } $(this).attr('data-content', files); $(this).popover('toggle'); 

from the code above, what input i get in popover is shown below

enter image description here

I read in some posts for adding / updating popover content via the content tag, but did not work. In addition, an HTML message was supplied for popover , which I did not receive. I do not know what to do to create new lines using the method described above or similar.

+5
source share
1 answer

You can either add data-html = "true" or do it in JS. For a JS solution, refer to How to add a line break in a jQuery popover .

+14
source

Source: https://habr.com/ru/post/1202130/


All Articles