Whenever I try to trigger a function by clicking on the label text, the click event seems to be firing twice.
HTML
<label class="label_one">
Label One
<input type="checkbox"/>
</label>
However, if I modify the HTML code as follows, the issue doesn't occur.
<label for="test" class="label_two">
Label Two
<input type="checkbox"/>
</label>
This is my current script:
$('.label_one').click(function(){
console.log('testing');
});
Could someone please explain why this behavior is happening?
Feel free to check out my jsfiddle here.