Click here to Skip to main content
13,090,299 members (90,206 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi Expert!

I have one checkbox that checked and unchecked on description click.

My code as par below
<input type="checkbox" id="chkId" />
<label for="chkId">Check</label>

It work fine with all browsers besides Mozilla (all version), when user click continue on checkbox's description (Mozilla) and on Internet Explorer 10, it work slowly, when user

clicked and unchecked. Why? This is very irritable.

Please give me solution that (checkbox) work properly on all browsers.

Please help me!

Any suggestion will be appreciated.

Thanks in advance!
Posted 8-Mar-13 0:04am
Updated 8-Mar-13 6:40am
ryanb31 8-Mar-13 7:20am
Where's the code?
Zoltán Zörgő 8-Mar-13 13:03pm
Is it bare html, or is there any javascript event handler attached?
Try it out as bare html also: just save these two lines in a test.html and see.
I have experienced that there is some slowness in Mozilla, but that was around 300ms - somewhat more than with Chrome, but acceptable.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Here is the simple solution:

You should not use Label at all, because it is redundant; the check box has its own text. Do something like this:
<input type="checkbox" id="chkId1" accesskey="A">This is option <u>A</u></input><br/>
<input type="checkbox" id="chkId2" accesskey="B">This is option <u>B</u></input>

This way, you will create accelerator keys for each control, according to underlined characters. Remember that in Mozilla, they are accessed via Alt+Shift+key, but on some other browsers via Alt+key.

As to the slow operation, this is not true. You could screw up your performance somewhere else; those controls themselves work just fine, and very fast.

Pravesh Singh 9-Mar-13 3:46am
I kanow, it work fine when we click on checkbox, but i want to checked checkbox on checkbox text(e.g. "This is option A") click, this work not properly when user continue click on checkbox text.
What is not working properly? It all depends on what you write in the handler. In detail please, what's not working. What exactly do you want to achieve?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 8 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100