Those are the values i use to fill out a form:
var champions = {
"Azir":["Shurima's Legacy","Conquering Sands","Arise!","Shifting Sands", "Emperor's Divide"],
"Dr. Mundo":["Shurima's Legacy","Conquering Sands","Arise!","Shifting Sands", "Emperor's Divide"]
};
The problem is with space instead of Dr. Mundo it shows as Dr. is there anyway to fix this problem?
Update:
echo '<input class="champion" type="text" list="champions" placeholder="Champion '.$i.'" name="champno[]" required autofocus><br/>
<datalist id="champions"></datalist>';
Jquery:
for(var key in champions){
if(champions.hasOwnProperty(key)){
$('#champions').append('<option value=' + key + '>');
}
}
for(var key in champions){ console.log(key) }... if you have that string as a json, then decoded it in php and iterate through it to get it's key name. Should work.