54
rated 0 times
[
60]
[
6]
/ answers: 1 / hits: 7464
/ 4 Years ago, thu, november 12, 2020, 12:00:00
If this is duplicate let me know, but I see similar questions for react environment but not for pure html+js.
The question is, I write js function as html onclick property and it is working :
<button onclick="function myFunction(){ alert('hi')} myFunction();">Hi</button>
But I can't write arrow function as html onclick prop like that :
<button onclick="()=>alert('hi')">Hi</button>
It is possible or not?
More From » html