So I wanted to add a name attribute on a textarea
inside the div
.
So my div
has an id
of textAreaEmail
.
Here's the syntax I've tried:
$(textAreaEmail).removeAttr('hidden');
$(textAreaEmail).children('textarea').attr('name', 'body');
Here's my HTML
, I used Form Helpers.
<div id="textAreaEmail">
<div class="form-group <?php echo ($form->error('body') ? 'has-error' : ''); ?>">
<?php echo label_tag('Body', 'body', true, array('class' => 'control-label'), ''); ?>
<?php echo textarea_field('body', $form->getField('body'), array(
'class' => 'form-control' . ($form->error('body') ? ' is-invalid' : ''),
'required' => true,
'id' => 'tinymce'
)); ?>
<p class="help-block invalid-feedback"><?php echo ($form->error('body') ? $form->error('body') : ''); ?></p>
</div>
</div>