There's a div called .description
in a form in the site I've inherited. I want to add a another class to the div.
The div's content is created within hook_form_FORM_ID_alter()
, eg:
$form['#description'] = 'Please enter your full name';
I've tried adding a classed to it like:
$form['#description'] = [
'#markup' => '<div class="my-class">Please enter your full name</div>',
];
But this just results in "Array" being printed.
Would anyone know what I could do add a class to this element?
s
' in the second example?#description
is not an element, its the description text - in this case it would be for the form itself. Does that text appear at the top of the form and not attached to anything?<div class="description">Please enter your full name</a>
. (I don't know where the description class is coming from.)