SyntaxFix
Write A Post
Hire A Developer
Questions
In events handler you can get id as follows
function show(btn) {_x000D_ console.log('Button id:',btn.id);_x000D_ }
<button id="myButtonId" onclick="show(this)">Click me</button>