現在 ajax を使用して新しいオプションを複数選択ボックスに追加していますが、それらにタイトル属性を追加しようとしても、まったく表示されていないようです。私が見逃しているものはありますか?
これは 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()
)
)