As Michael noted in his answer, the popover element does not exist in HTML until a link is clicked. Therefore, the click handler cannot attach to it until the link is clicked. Thus, you can either move the click handler to the popover call, or use the jQuery on delegate, for example:
$('.location').on('click','.text-btn',function () { alert('What\ going on!');
See this work in fiddle
This is done as follows: it attaches a click handler to an element with the location class. When something inside this element receives a click (for example, the text-btn ), the event bubbles up and fires this handler. However, the on handler only listens for events that are fired by certain elements (in this case, elements that have the text-btn ). Since the handler is bound to the .location element, and this element is not dynamic, it will always be available.
Steve source share