Bootstrap adds and removes markup for popover dynamically, so you just need to check for the existence of the element.
If you go to the Bootstrap example page: http://twitter.github.com/bootstrap/javascript.html#popovers , you can switch your example using the big red button displayed where it says: “Click to switch popover”
This jquery selector is written to select this popover element if it exists $ ('# Popovers'). Find ('h3'). Equation (5) .next (). Find ('popover')
To check its state (exists or not), check if the length of the set of returned elements is 0.
So, click the button to switch your example, and then run the following in the console:
TOGETHER TO POP ON
console.log( $('#popovers').find('h3').eq(5).next().find('.popover').length === 0 ); // false
TRACK THE SURE.
console.log( $('#popovers').find('h3').eq(5).next().find('.popover').length === 0 ); // true
PS - I hope you write the best selector, since you already know that you will need to check that the popover exists on the page or not.
EDIT: jsfiddle link HERE
source share