How to select an option row in a datalist without using the option value ?

How to select an option row in a datalist without using the option value ?

Hi,
I've found something usefull in a forum to select an option row in a datalist but unfortunatly, it works only if the option value is unique.
For example, It does not work for this list:
  1. <datalist id="myfriends">
    <option value="John Doe"  data-id="0"> John Doe is living in Vancouver
    <option value="John Doe"  data-id="1"> John Doe is living in Paris
    </datalist>
Please see my example and this code here : https://jsfiddle.net/peter45/Lnuqxt9o/
Thank you for your reply.