javascript - Event for multiple div's with same ID -


edit: needed use class, pointing 1 out me

i have following div's:

<div class="section-link" id="section-tooltip" data-content="popup option trigger" rel="popover" data-placement="right">     <div class="section-features" style="display: none;">     content     </div> </div> <div class="section-link" id="section-tooltip" data-content="popup option trigger" rel="popover" data-placement="right">     <div class="section-features" style="display: none;">     content     </div> </div> <div class="section-link" id="section-tooltip" data-content="popup option trigger" rel="popover" data-placement="right">     <div class="section-features" style="display: none;">     content     </div> </div> 

as can see using same id, trying make popover in bootstrap following jquery doing 1 div , trying have them without having set individual id's.

$('#section-tooltip').each(function(){         $(this).popover({     trigger: "hover",     html : true,      content: function() {       return $(this).children('div:first').html();     }     }); }); 

convert id class, modify code:

<div class="section-link section-tooltip" data-content="popup option trigger" rel="popover" data-placement="right">     <div class="section-features" style="display: none;">     content     </div> </div>  $('.section-tooltip').each(function(){     $(this).popover({         trigger: "hover",         html : true,          content: function() {             return $(this).children('div:first').html();         }     }); }); 

this assuming have other elements using same class (.section-link) do not wish behaviour apply. otherwise use class instead.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -