javascript get button by id code example
Example 1: get element by id in javascript
document.getElementById("YourElementId");
Example 2: get id of clicked element javascript
<button id="3" onClick="reply_click(this.id)">B3</button>
<script type="text/javascript">
function reply_click(clicked_id)
{
alert(clicked_id);
}
</script>