I am trying to run some function when clicking on the label text but the click event fired two times.
HTML
It is because of event bubbling.
In general all elements bubble the event to the root of the document whereas the label tag will bubble the event to its child nodes and thats how the input tag is getting ticked when you click the label dom.
So in your case you attached the event handler to label tag so
label tag again hence it is called twice.To solve this, just attach the event handler to input/checkbox tag it should work fine.