I have a form with id
equal to webform_client_form_3
. I have a particular field that I'm altering by applying a class to it like so:
$form['submitted']['estimated_annual_distribution_of_effort']['sensor_technology']['#attributes']['class'][] = 'span1';
This all works great. However, I also need to add a class on to the label for that particular element as well. Looking through the $form
array, I haven't been able to find anything that gives access to the labels. Am I just missing something or are the labels not part of the $form
array?
UPDATE WITH SOLUTION:
I used Clive's response and took it a step further. My tweak and documentation is a bit long-winded so I created a separate blog post about it here.