I need to use <a> inside the <label> . Since there are many CSS styles in our current system, they apply only to <a> . The <a> tag is not associated with any pages, but for styling / hovering.
See the code below:
<input type="checkbox" id="my-id"> <label for="my-id"><a href="javascript:void(0)">Some text</a></label>
But when you click on "Some text", it does not switch the status of the flag.
I tried $.preventDefault() in the <a> tag but it does not work.
What should I do to make <a> behave like a label?
source share