From this question , maybe you just need to add an attribute title
. In this case, this should work:
function dynAddOption(list, elementToBeAdded){
if (list.length > 0) {
for(var index = 0; index < list.length; index ++) {
var opt = new Option(list[index].description, list[index].id);
opt.title = 'Foo';
elementToBeAdded.options[index + 1] = opt;
}
}
}
source
to share