I have some input fields and a link in my html. I want to pop a popover on the link when any of the input fields are clicked. The codes are given below :
$('.name').on('click', function(){
$('[data-toggle="popover"]').popover('show');
});
I get the popover, but I need to define placements and other attributes. I tried in the following way, but failed
$('.name').on('click', function(){
$('[data-toggle="popover"]').popover('show',{
placement : 'top'
});
});
Any help is appreciated.
You could use the following:
$('.name').on('click', function () {
$('[data-toggle="popover"]').popover({
placement : 'top',
content : 'I am a popover!'
}).popover('show');
});