Checkbox Text | JavaScriptSource

Checkbox Text

JavaScriptSource Staff Jul 20, 2000


The user no longer needs to click precisely on the checkbox to check and uncheck it. Clicking the text after the checkbox will also select it.

Clicking this text also checks the box to the left.


  • Posted: July 20, 2000

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: checkboxText.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Yes, but there are times when that is not possible. For instance, when a table is being used for layout, and the label is in one cell and its associated control is in another cell.

Lee Nov 18, 2008

Just use the (X)HTML <label> tag to put focus onto a specific input object. For example:[br /]<input type="checkbox" name="checkboxName" id="checkme"> <label for="checkme">Select this checkbox</label>[br /][br /][br /]Problem solved! Now, all of your visitors (with or without JavaScript enabled) can click on the text.

Jeffrey Bennett Nov 17, 2008

nice script it solved my problem.

Siraj Ali Apr 2, 2008