How do I wrap the label text of a checkbox with a span tag? I have noticed that Drupal 7 generates check-boxes with a markup like this:

&lt;label ..&gt;
&lt;input type="checkbox"&gt;
Label text ..
&lt;/label&gt;


I want to wrap  Label text .. inside a span tag, how to do that via the Drupal 7 API?

The result should be:

&lt;label ..&gt;
&lt;input type="checkbox"&gt;
&lt;span&gt;Label text ..&lt;/span&gt;
&lt;/label&gt;
You would either need to override theme_form_element in your theme, or, do a hook_form_alter, target specific checkbox form elements, and change their #theme_wrappers callback to your own theme implementation.

I personally would do the latter, since overriding theme_form_element will change the default rendering for any form element in your theme, and that may not be desirable in every scenario.