How to soley wrap the -field in a custom -wrapper in Webform 4.x? I've a fairly simple question. Due to a given CSS I need to wrap the &lt;input&gt;-field (as well as &lt;select&gt; or &lt;textarea&gt;) of webform-component with a custom &lt;div&gt;-wrapper.

Change the follwoing ->

&lt;div class="webform-component webform-component-textfield webform-component--title"&gt;
    &lt;label for="edit-submitted-title"&gt;Name&lt;/label&gt;
    &lt;input type="text" id="edit-submitted-title" name="submitted[title]" value="" size="60" maxlength="128" class="form-text required"&gt;
&lt;/div&gt;


to ->

&lt;div class="webform-component webform-component-textfield webform-component--title"&gt;
    &lt;label for="edit-submitted-title"&gt;Name&lt;/label&gt;
    &lt;div class="my-custom-class"&gt;
         &lt;input type="text" id="edit-submitted-title" name="submitted[title]" value="" size="60" maxlength="128" class="form-text required"&gt;
    &lt;/div&gt;
&lt;/div&gt;


I tried this snippet (changing #prefix and #suffix with hook_form_alter()), but it wraps the whole webform-componoent in a custom div.

Result is like this:

&lt;div class="my-custom-class"&gt;
    &lt;div class="webform-component webform-component-textfield webform-component--title"&gt;
        &lt;label for="edit-submitted-title"&gt;Name&lt;/label&gt;
        &lt;input type="text" id="edit-submitted-title" name="submitted[title]" value="" size="60" maxlength="128" class="form-text required"&gt;
    &lt;/div&gt;
&lt;/div&gt;


I also tried to modify #field_prefix and #field_suffix with, but it doesn't result in any output at all. It seems, that these doesn't allow to have any custom html in it.

Any suggestions? Thanks.
Use hook_form_alter and add "'#title_display'    => 'none'," and use label in prefix. e.g.

if($form_id == "content_type_node_form"){
   $form['field_name']['#prefix'] = '&lt;label for="edit-submitted-title"&gt;name&lt;/label&gt;&lt;div class="newclass"&gt;';
   $form['field_name']['#suffix'] = '&lt;/div&gt;';
}


I have not tested it but this can work.