I have the following code inside a bootstrap modal - the data is being pulled from a button (that triggers the modal)
<script>
$('#myFavorites').on('show.bs.modal', function (event) {
// Heart Icon triggers
var heart = $(event.relatedTarget)
// Button that triggered the modal
// List of variables
var user = heart.data('user')
var title = heart.data('track')
var artist = heart.data('artist')
// Print to screen
var modal = $(this) modal.find('.modal-title').html('User: ' + user + '<p>Song: ' + title + '</p><p>Artist: ' + artist)
// modal.find('.modal-body input').val(title)
})
</script>
This all prints out on one line. How can I format it like so (with simple breaks to a new line):
User: 01
Song: Title Here
Artist: Artist Name Here
Source: URL Here
Poster: Poster Here
I injected the \n in several places but it broke the code?
<br>?<pre>?col-md3, or create an HTML table.