Question T104
Visible to All Users

Add custom css to each answer of a question

created 7 years ago

Hi,
when a user submit a survey we want somebody else to evaluate. This guy could reject an answer and give it back to the submitter.
This submitter should see which answer has been accepted and which not, e.g. we want to set green and red backgroundcolor to each answer. Is there an easy way to set custom css-classes per question or answer?
Best Regards
Richard

Comments (1)

    You can use onAfterRenderQuestion event to mark the question with certain css style or id.

    The event is fired right after a question is rendred in DOM. Use it to modify html elements. There are two parameters in options: options.question, options.htmlElement

    sender the survey object that fires the event
    options.question a question object for which the event is fired
    options.htmlElement an html element binded with the question object

    More details are available at the https://surveyjs.io/Documentation/Library/?id=surveymodel