I need to read a data value conteined into a from a bootstrap popver.
Details:
There is a popover associated to a panel. Into the popover there is a link that fires (by onClick) a function that have to read the value of the attribute data-info contained into the panel div.
HTML code:
<div class="panel panel-success redim" data-info="informations" data-content="<div onClick="modifica_appuntamento()" class="text-center"><a href="#">Get info</a></div>" data-original-title="Get data from popover">
<div class="panel-heading">Heading</div>
<div class="panel-body">Body</div>
</div>
Jquery:
$(function() {
popoverOptions = {
html: true,
animation: true
};
$('.panel').popover(popoverOptions);
});
function modifica_appuntamento() {
alert($(this).parent().data('info'));
}
JSFiddle: https://jsfiddle.net/fabioravizzotti/3h4vu8Ly/
Can you help me to find a solution?
Thanks.