Good evening, I have a modal to display information about a product, until then I can display this data with this script
$('a[data-target="#saberModal"]').on('click', function (e) {
e.preventDefault();
var nome = $(this).data('nome');
var descricao = $(this).data('descricao');
$('div.textoSaber').html(nome + descricao);
$('#saberModal').modal('show');
return false;
});
Only the name sticks to the description, I would like to know how to format these elements in my html so that they are displayed correctly. I tried changing the script this way.
$('a[data-target="#saberModal"]').on('click', function (e) {
e.preventDefault();
var nome = $(this).data('nome');
var descricao = $(this).data('descricao');
$('div.textoSaber').html(nome);
$('div.descricao').html(descricao);
$('#saberModal').modal('show');
return false;
});
but only the name is displayed, the description is not.