0

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 ?

Community
  • 1
  • 1
Abhishek Tripathi
  • 1,211
  • 2
  • 15
  • 30

1 Answers1

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)

Community
  • 1
  • 1
SwagBomb
  • 584
  • 3
  • 7