And why is the input within the label?

I was under the impression that the correct format is:
<label>My Label</label><input type="checkbox" />

To have the label select the checkbox:
<label for="my-checkbox">My Label</label><input id="my-checkbox" type="checkbox" />

David

MorningZ wrote:
is there any reason why you couldn't use a <span> instead of a
<label> ?


On Mar 8, 8:57 pm, Bill <bllfr...@gmail.com> wrote:
I have markup that looks like this:

<div id="phrase:witness%2Bwhereof" class="as-s-comp">
    <label class="checkbox" title="witness whereof">
        <input type="checkbox" value="witness whereof"/>
        witness whereof
    </label>
    <a class="cl" href="#">(4104)</a>
</div>

When I click anywhere within the label, the checkbox toggles from its
previous state. I'd like to cancel this behavior, so that clicking
within the label has no effect on the checkbox. How would I use jQuery
to accomplish this?

Thanks in advance for any help with this.

--Bill

Reply via email to