i have been working on a chrome extension and with the help of this post triggering javascript function on click and getting element details which is clicked, i am getting the element details clicked on but the problem is this extension keep on running ! i want to trigger it just once every time i click a button from devtools page of my chrome extension. how to do this ?
Asked
Active
Viewed 116 times
1 Answers
1
You will need to implement a removeEventListener
after your event implementation
document.getElementById("ID").removeEventListener("click", myFunction);
You can use this SO post as a referrence (JavaScript: remove event listener)
-
Thank you for the help @SwagBomb – Abhishek Tripathi Mar 14 '16 at 08:03