Tokenize2 icon indicating copy to clipboard operation
Tokenize2 copied to clipboard

Add class or attribute to inserted token <li> tag

Open JivanRoquet opened this issue 4 years ago • 0 comments

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" }
}

JivanRoquet avatar Mar 25 '20 12:03 JivanRoquet