Programming Exercises

Create a tooltip that appears when hovering over a button.

Medium

Problem Statement

Create a tooltip that appears when hovering over a button.

Sample Output

A tooltip appears above the button when hovered.

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<!DOCTYPE html> <html> <head> <style> /* Add CSS here to style the tooltip */ </style> </head> <body> <div class="tooltip"> <button>Hover Me</button> <span class="tooltip-text">Tooltip text</span> </div> </body> </html>
Log in or sign up to run or submit your code.Log inSign up
Expected Output
A tooltip appears above the button when hovered.