Answers for "how to get on click id in event"

1

how to get on click id in event

<button id="1" onClick="reply_click(this.id)">B1</button>
<button id="2" onClick="reply_click(this.id)">B2</button>
<button id="3" onClick="reply_click(this.id)">B3</button>
    
<script type="text/javascript">
  function reply_click(clicked_id)
  {
      alert(clicked_id);
  }
</script>
Posted by: Guest on January-07-2021

Code answers related to "how to get on click id in event"

Code answers related to "Javascript"

Browse Popular Code Answers by Language