On making every AJAX call I cannot just keep filling the drop down list, as I have to clear the dropdown after every success call.

So I need a function which is capable of making the drop down list empty.


function ClearDropDown(ddl)

  var len = ddl.options.length;
    for (i=0; i<len; i++) {
       ddl.remove(0); //It is 0 (zero) intentionally