I want to count the number of duplicate specified value in a spinner list

Dears , I want to count the number of duplicate specified value in a spinner list

Use evaluate js in web viewer components, and get the result in when web viewer string change event