target

Gets the current target of the Popover.

Example - getting the current target of the popover

<div id="container">
  <span id="target1">Popover target1</span> <br />
  <span id="target2">Popover target2</span>
</div>

<button id="targetButton" class="k-button">Log target</button>

<script>
  $(document).ready(function() {

    var popover = $("#container").kendoPopover({
      filter: "span",
      template: function (e) {
        return e.target.text();
      },
      position: "right"
    }).data("kendoPopover");


    $("#targetButton").click(function() {
      var target = popover.target();
      if (target) {
/* The result can be observed in the DevTools(F12) console of the browser. */
        console.log(target.attr("id"));
      }
    });
  });
</script>

Returns

jQuery - The target element or null.

In this article