Edit this page

content Object |String |Function

The text or a function which result will be shown within the Tooltip. By default the Tooltip will display the target element title attribute content.

If you need to retrieve the title attribute of the target from inside the content function, then use target.data("title"), as shown below.

If the content passed to the Tooltip includes scripts, they will be executed. If this is not desired, make sure to strip any undesired content in advance.

Example - extract the content from target element content

<div id="container">
    <span title="foo">Some content</span>
    <span title="bar">Some more content</span>
</div>

<script>
    $(document).ready(function() {
      $("#container").kendoTooltip({
        filter: "span",
        content: function(e) {
          var target = e.target; // the element for which the tooltip is shown
          return target.data("title") + " " + target.text(); // set the element text as content of the tooltip
        }
      });
    });
</script>

Example - content as static text

<span id="target">
    Some content
</span>

<script>
    $(document).ready(function() {
      $("#target").kendoTooltip({
        content: "Tooltip content!"
      });
    });
</script>

content.url String

Specifies a URL or request options that the Tooltip should load its content from.

Note: For URLs starting with a protocol (e.g. http://), a container iframe element is automatically created. This behavior may change in future versions, so it is advisable to always use the iframe configuration option.

Example - load content from remote URL

<span id="target" title="Tooltip content">
  Some content
</span>

<script>
  $(document).ready(function() {
    $("#target").kendoTooltip({
      content: {
        url: "https://demos.telerik.com/kendo-ui/content/web/tooltip/ajax/ajaxContent3.html"
      },
      width: 220,
      height: 280
    });
  });
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy