I'm currently using ajax to append new options to a multiple select box, but even though I'm trying to add title attributes to them, they don't seem to be displaying at all. Is there something that I'm missing?
This is done in Coffeescript:
$.ajax(
type: 'get'
url: '/Filter/LookupClassification'
data: ( term: inputVal )
dataType: 'json'
success: (response)->
select = document.getElementById('getClassBox')
select.options.length = 0
$.each(response, (key, value)->
option = $(
'<option/>'
'title': value.toUpperCase()
'value': key
).text(key + ' - ' + value.toUpperCase())
$('#getClassBox').append(option)
)
$('#selectClassBox option').each((index, value)->
val1 = $(value).val()
if $('#getClassBox option').val() is val1
$('#getClassBox option[value=' + val1 + ']').remove()
)
)