Add a custom id in textarea I need to add an ID into a textarea of body field on my custom "node-form.tpl.php". Now this body field will be rendered like this:

&lt;textarea class="text-full form-textarea" id="edit-body-und-0-value" name="body[und][0][value]" cols="60" rows="20"&gt;&lt;/textarea&gt;


I want to add a ID redHat into the texarea, that output should be:

&lt;textarea class="text-full form-textarea" id="edit-body-und-0-value redHat" name="body[und][0][value]" cols="60" rows="20"&gt;&lt;/textarea&gt;


To do this i have used hook_form_alter() in my template.php with no luck!

function bartik_form_alter( &amp;$form, &amp;$form_state, $form_id ) {
if($form_id == "article_node_form"){
    $form['body']['und']['0']['value']['#attributes']['#id'][] = 'redHat';
}
}


what i am missing? Thanks
Each element should have only one ID and it should be unique. You can change the body texarea id with the hook_form_alter()

Example

/**
* Implements hook_form_alter().
*/
function YOURMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  if (isset($form['#node']) &amp;&amp; $form['#node']-&gt;type == 'article') {
    // body textarea ID 
    $form['body']['und']['0']['#attributes']['id'] = 'redHat';
  }
}


but you cannot add the next one.