Update 11_events.md

You made a correction in the HTML code by removing the `onclick` attribute from the `<button>` element and placing it inside the element as an event handler. This change ensures that when the "Greet People" button is clicked, it will call the `greetPeople()` function correctly.
pull/374/head
Sattu_13_7 2 years ago committed by GitHub
parent 8b41cd49c3
commit 86ec15a999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,7 +48,7 @@ Event handling in HTML
<title>30 Days Of React App</title> <title>30 Days Of React App</title>
</head> </head>
<body> <body>
<button>onclick="greetPeople()">Greet People</button> <button onclick="greetPeople()">Greet People</button>
<script> <script>
const greetPeople = () => { const greetPeople = () => {
alert('Welcome to 30 Days Of React Challenge') alert('Welcome to 30 Days Of React Challenge')

Loading…
Cancel
Save