DEV Community

Abhishek Ramesh Pakhare
Abhishek Ramesh Pakhare

Posted on

1 1

Is there any way to put HTML code in Tooltip?

Top comments (4)

Collapse
 
weeb profile image
Patrik Kiss • Edited

I guess it depends on what kind of framework you are using (if you are).

If you use bootstrap tooltip, then yes, it's easily possible, using data-html attribute, and set it to true. Like data-html="true"

It's in the documentation

Collapse
 
abhishekpakhare97 profile image
Abhishek Ramesh Pakhare

Thank you so much for your response. I am familiar with bootstrap but right now I am using Materialize CSS framework. What I want to do is to make a table within the tooltip

Collapse
 
mpuckett profile image
Michael Puckett • Edited

As far as accessible HTML, it may be a good candidate for a non-modal dialog element, especially if the table is interactive. Basically you add it after the tooltip and then add the open attribute when tooltip is clicked. Unfortunately it has limited browser support but the accessibility mechanics can be replicated with role=dialog and some JavaScript.

Collapse
 
abhishekpakhare97 profile image
Abhishek Ramesh Pakhare

Thank you so much for you support and reponse

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️