I an using ASP.NET MVC 4 to dynamically load a PartialView which contains a option. I want to bind a jQuery dblclick event to this and get the selected option, but the event is not firing. Here is my code:
<select size="5" id="popup-list">
<option value="test">test</option>
</select>
jQuery code:
$(document).ready(function(){
$("#popup-list").live("dblclick", function () {
var name;
$("select option:selected").each(function () {
name = this;
name = this.text();
});
});
});
I am not sure as the why this is causing a problem. The code is in a document.ready(), which should take care of the dynamic loading.