I need to add a class name to certain labels created by Drupal's form API like this:
$form['name'] => array(
'#type' => 'textfield',
'#title' => 'Prénom'
);
If I use the following, the <textarea>
gets a class, but not the label.
$form['name']['#attributes']['class'] = array('myClass');
I'm looking for something similar that will add a class to the <label>
.
.field-name-field-myfield label{ color:red; }