I have script to show dropdown in select box. The script currently i am using is
jQuery.each( dslr, function( index, dslrgp) {
var aslrp= dslrgp.aslrp;
jQuery.each( aslrp, function(index2, pslrp) {
var found = 0;
jQuery.each( dropdown, function(index3, dditem) {
if (dditem.countryname == pslrp.countryname)
{
foundit = 1;
}
});
if (foundit == 0)
dropdown.push(pslrp);
});
});
How can i convert this to pure javascript. Because if i am using this
dslr.forEach(function( index, dslrgp) {
var aslrp= dslrgp.aslrp;
aslrp.forEach(function(index2, pslrp) {
var found = 0;
dropdown.forEach(function(index3, dditem) {
if (dditem.countryname == pslrp.countryname)
{
foundit = 1;
}
});
if (foundit == 0)
dropdown.push(pslrp);
});
});
it is not working.