SyntaxFix
Write A Post
Hire A Developer
Questions
This will log the id of the element that's been clicked: addFields.
<button id="addFields" onclick="addFields()">+</button> <script> function addFields(){ console.log(event.toElement.id) } </script>