Javascript define a function within event handler
How can I write a function within the onclick event of a button What I want to do is something similar to this: <button onclick=”(function(){ console.log(‘some code here’) })”>My button</button> Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So … Read more