How to check whether Dropdownlist has any items or not in Javascript?

 Posted by vishalneeraj-24503 on 12/27/2013 | Category: JavaScript Interview questions | Views: 1351 | Points: 40
Answer:

With the help of options.length property of Dropdownlist control,we can check.

var ddl = document.getElementById('<%=ddl_name_list.ClientID%>');

alert(ddl.options.length);


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response