<button type="button" class="button" onclick="clicked(this.id);" id="6">6</button> <button type="button" class="button" onclick="clicked(this.id);" id="7">7</button> code example
Example: 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>