I create two selectors. When I double click one option in a selector, the value selected will show in another selector. Suddenly, it didn’t work. I double click one option in the left selector that can’t get the option value. If I click one option once then double click again, it will work. I have no idea what’s happening.
<code> this.dClick = function(ele, ele2){
var _nut = navigator.userAgent.toUpperCase();
var isIE=(_nut.indexOf("MSIE") >= 0 || _nut.indexOf("WINDOW") >= 0)?true:false;
if(isIE){
$(ele).dblclick(function(){
var objThis = $(this).find(':selected');
console.log(Object.entries(objThis));
var ok_add = true;
if(ok_add){
var nOption = $("<option></option>").attr("value", $(objThis).val()).text($(objThis).text()).prependTo(ele2);
obj.dOptionClick(nOption, ele2, ele);
$(objThis).remove();
}
});
}
}
</code>
<code> this.dClick = function(ele, ele2){
var _nut = navigator.userAgent.toUpperCase();
var isIE=(_nut.indexOf("MSIE") >= 0 || _nut.indexOf("WINDOW") >= 0)?true:false;
if(isIE){
$(ele).dblclick(function(){
var objThis = $(this).find(':selected');
console.log(Object.entries(objThis));
var ok_add = true;
if(ok_add){
var nOption = $("<option></option>").attr("value", $(objThis).val()).text($(objThis).text()).prependTo(ele2);
obj.dOptionClick(nOption, ele2, ele);
$(objThis).remove();
}
});
}
}
</code>
this.dClick = function(ele, ele2){
var _nut = navigator.userAgent.toUpperCase();
var isIE=(_nut.indexOf("MSIE") >= 0 || _nut.indexOf("WINDOW") >= 0)?true:false;
if(isIE){
$(ele).dblclick(function(){
var objThis = $(this).find(':selected');
console.log(Object.entries(objThis));
var ok_add = true;
if(ok_add){
var nOption = $("<option></option>").attr("value", $(objThis).val()).text($(objThis).text()).prependTo(ele2);
obj.dOptionClick(nOption, ele2, ele);
$(objThis).remove();
}
});
}
}
Could anyone have any suggestion? Thanks.