Tokenize2
Tokenize2 copied to clipboard
Add class or attribute to inserted token <li> tag
When selecting a value from the dropdown list, the inserted li
tag is of the following form:
<li class="token" data-value="US">...</li>
Is it possible to add an additional class or attribute like the following:
<li class="token" data-value="US" data-continent="America">...</li>
<!-- or -->
<li class="token america" data-value="US">...</li>
Source data structure is as follows:
data = [
{ value: "US", text: "United States", continent: "America" },
{ value: "FR", text: "France", continent: "Europe" },
{ value: "JP", text: "Japan", continent: "Asia" }
}