I have an input token in my form, so I want each comma-separated token to have a different background color. My question is, how do I style each element by value or can I use id in the value?
I want to
- red to use a red background,
- blue to use a blue background,
- green to use a green background,
- etc.
What should I do for this? Here is my code:
<input value="red,blue,green"
type="text"
id="exampleInlineTags"
class="form-control token-example-field"
name="search"
placeholder="Enter tags" />
source
share