The Bell چالش 2 از جلسهی 11، آسان
دکمهی زنگ کاری نمیکند. با یک تابع فلشی کوتاه کاری کن که با هر کلیک پیام Ding! بیاید.
<style>
body { font-family: sans-serif; text-align: center; padding: 16px; }
button, input, select { font-size: 16px; min-height: 40px; margin: 4px; }
</style>
<div id="root" dir="ltr"></div>
<script type="text/jsx">
import { createRoot } from "react-dom/client";
function App() {
return <button id="bell">Bell</button>;
}
createRoot(document.getElementById("root")).render(<App />);
</script>
راهنما و جواب این چالش · برگشت به درس جلسهی 11: کلیک · چالش بعدی: Yes or No
بیشتر بخوان: جاوااسکریپت چیست؟ از دکمهی وب تا Node.js