I am trying to add a bootstrap popover to a div element that contains arbitrary content like so (but what I came up with doesn’t work):

<div id="popover-target">
   <h3>I need a popover</h3>
        This is some content for the section
        that needs to be explained by the popover.
<button class="btn">Show popover</button>

            $('#popover-target').popover({title: 'Title', content: 'Test Content', container: 'body', placement: 'right'});

If I change $('#popover-target') to $('.btn') then the popover displays correctly. Any ideas?