How do I add a class to the label and field on one row of the editor form?

How do I add a class to the label and field on one row of the editor form?

lelizondolelizondo Posts: 1Questions: 1Answers: 0

I see this in the discussion to add a class to the select field of the editor:
editor.field('Task Type.Execute Continuously').input().addClass('form-border-bottom');

but, what would be the syntax for the label and the input field say if I would like to add a HR above the row or change the background color?

Thanks.

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    The method to use here is field().node(). That will give you container element for the field, so you can then use a little jQuery to get anything you want from inside it - e.g.:

    $( 'label', editor.field('myField').node() ).addClass( 'myClass' );
    

    Allan

This discussion has been closed.