Articles in this section
Category / Section

Does ejTooltip supports HTML content from the title attribute of the target element?

1 min read

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>

 

 

Tooltip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied