Create a button that, when clicked, displays an alert saying 'Button clicked!'.
EasyProblem Statement
Create a button that, when clicked, displays an alert saying 'Button clicked!'.
Sample Output
An alert box that says 'Button clicked!'
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React from "react"; const ClickAlert = () => { const handleClick = () => { // Add alert logic here }; return ( // Add button element here and link the click handler <></> ); }; export default ClickAlert;