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><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>
Also in JavaScript:
- create label dynamically in javascript
- post antiforgerytoken jquery
- ng has unexpectedly closed (exit code 127).
- javascript write to firebase
- javascript Error: Invalid web service call, missing value for parameter: 'documentId'.
- data for bar plot json
- await on observable
- js prompt
- discord js stats command
- vue axios catch error
- disable radio button javascript
- array sort
- array sorting javascript insertion sort
- mongodb nodejs connect localhost
- javascript listen for double click
- ngswitchcase in angular 8
- javascript get date without time
- redondear de 0.05 en 0.05 javascript
- using aria attributes in angular
- node server code
- joi in node and express
- angular vs react
- two dimensional array in javascript example code
- jquery visibility effects