需要更新您的 jQuery 代码并选择 html 代码。
jQuery 更新代码:
$('#selectbox').on('change', function (e) {
var optionSelected = $("option:selected", this);
var valueSelected = this.value;
var proid = valueSelected.split(":");
$("#searchInput").val(proid[0]);
});
Html 更新代码:
<select name="" id="selectbox" multiple="multiple">
<option value="ankit:naredi">ankit:naredi</option>
<option value="suyog:ma dle">suyog:ma dle</option>
<option value="sushil:tade">sushil:tade</option>
<option value="">dipen tiwari: kumar</option>
<option value="">suyog: sarang</option>
<option value="">sushil</option>
<option value="">suyog</option>
<option value="">sushil</option>
<option value="">suyog</option>
<option value="">sushil</option>
</select>
需要将选项值放在 jQuery 之上。
http://jsfiddle.net/kzpFA/9/