I populated the dropdown with the help of array. for example I have array with elements (ali,abid,naqvi).


when I clear the cache and reload the page. and first time I am unable to select first value which is "ali". but if after cache clear and page reload, I select "abid" or "naqvi" first time and then select "ali" it work fine.

in short...after page reload I cann't select first value of dropdown unless I select other values first.

  • Sharing your code would be better than explaining. please share – Ghulam.M Feb 12 at 13:41
  • yeah you are right bro. but I got the answer – Muhammad Ali Feb 15 at 7:16

Actually problem was that I was using "onchange" function. When I used "onclick" it was working fine and also select the first value from drop too.like I was using

$('.pro_size').on('change', function(event){

after modification

$('.pro_size').on('click', function(event){ =>worked fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.