I have a project developed in Bootstrap, where clicking link Products will open a Bootstrap Modal with the products listed. However, I would like you to click on one of the products to close the modal and the clicked product would appear in a <div>
under the link clicked. Until the modal and the product listing I was able to do it, but the product name underneath the link clicked I could not. Could someone help me?
<script type="text/javascript">
function Aparecer(produto){
var nome;
document.getElementById("Produtos").innerHTML = produto;
}
</script>
<a href="#" onclick="javascript:Aparecer(<?php echo $produto; ?>)">Selecionar</a>
<div id="Produtos"></div>