How do I add a custom class to a HTML input? | XM Community
Solved

How do I add a custom class to a HTML input?

  • 6 February 2019
  • 1 reply
  • 47 views

Userlevel 4
Badge +20
Looking to create a unique identifier on a HTML input to be able to hook up a multi select js function.
icon

Best answer by TomG 6 February 2019, 20:42

View original

1 reply

Userlevel 7
Badge +27
The selector for the input will vary based on the type of question. For this example, I'm assuming a text input:
```
jQuery("#"+this.questionId+" input[type=text]").addClass("customClassname");
```

Leave a Reply