I want to compare the number of items in two select elements(HTML). I tried using length property(with jquery) but it always says that both select element have number of option =1. I am populating both the select elements dynamically. What to do?
var $options=$("#test_select");
$options.empty();
$.each(t_test_list,function(index,value){
$options.append($("<option>").text(value).attr("value",value));
});
var numdate=$("#date_select").length;
var numtest=$("#test_select").length;
alert(numdate);
alert(numtest);
if(numdate!=numtest)
{
alert("The number of dates do not match test cases!!!");
}