Does ejTooltip supports HTML content from the title attribute of the target element?
Yes, ejTooltip supports the HTML content from the title attribute of the given target element.
The default browser tooltip does not support the html element in the title attribute to display the tooltip.
ejTooltip will fetch the text or any html elements from the title attribute of the target element if the content property is not specified in the tooltip properties list and rendered to the tooltip wrapper.
Please refer the following sample.
Step 1: In title attribute, we have given the value as 'ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and <a href="http://www.ecmascript.org/"> more</a>.' We have used ‘<a>’ element in the title attribute.
Javascript
<div class="frame"> <div class="control"> JavaScript is a high-level, dynamic, untyped, and interpreted programming language. It has been standardized in the <a id="link1" title='ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and <a href="http://www.ecmascript.org/"> more</a>.'><u> ECMAScript </u> </a>language specification. </div> </div>
|
Step 2: Define the tooltip as follows. In declaration we did not specify the content for the Tooltip. Because the content will be fetched from the title attribute.
Javascript
<script type="text/javascript"> $(function () { $("#link1").ejTooltip( { width: "10%" }); }); </script>
|