What is wrong with this jquery each() select options? -


i have below function,

function setdropdownvalue(dropdownid,selectedvalue){             $('#'+dropdownid+' option').each(function(){                  if ($(this).val().tolowercase()==selectedvalue.tolowercase()){                      //found option  looking for, want                      $(this).val(selectedvalue);                  }             });         } 

and passing dropdownid=$('#dp1") , selectedvalue='bat' , reason each() function not getting executed.. calling setdropdownvalue($("#dp1"),'bat');am missing something??

dropdownid should string, why passing $('#dp1") jquery object?

you should pass 'dp1' instead.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -