Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I am try to create toolTip for anchor tags which inside the html table. i need to fetch some information from database based on the Id assigned to data-attribute of anchor tags. this information need to be shown in tooltip.
following is my Html .
<pre lang="HTML"> <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
            </tr>
        </thead>
        <tbody>

            @foreach (var item in Model)
            {
                <tr>
                    <td><a href="#" data-id="@item.Id">@item.Id</a> </td>
                    <td>@item.Name</td>
                </tr>
            }

        </tbody>
    </table>"

"


also. i am using jquery 1.8.2 version and i can't upgrade this version. so anyone who can help me to solve this

thanks and regards
sunny
Posted

You can display the tooltip with title property of a tag.

HTML
<table>
<thead>
    <tr>
        <th>Id</th>
        <th>Name</th>
    </tr>
</thead>
<tbody>

    @foreach (var item in Model)
    {
        <tr>
            <td><a href="#" data-id="@item.Id" title="@item.Id">@item.Id</a> </td>
            <td>@item.Name</td>
        </tr>
    }

</tbody>
</table>
 
Share this answer
 
Hi you can do it in the same way as done in the below link. you should use jQuery tooltip..follow this link
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900