JavaScript – onClick to get the ID of the clicked button

How do find the id of the button which is being clicked?

<button id="1" onClick="reply_click()"></button>
<button id="2" onClick="reply_click()"></button>
<button id="3" onClick="reply_click()"></button>

function reply_click()
{
}

 

Add Comment



  • 0 Answer(s)



  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.