I need to make array from class name that have no class name ‘hidden’:
<div id="part2">
<div class="address hidden">address</div>
<div class="floors">floors</div>
<div class="postcode"> </div>
<div class="city hidden"> </div>
</div>
i can go over the divs and make array as follows but i need only divs that have no class hidden-in this case only ‘floors’ and ‘postcode’.
var list_div_class = function() {
var myarray = [];
$('#part2').children().each(
function(index) {
var myclass = $(this).attr("class");
myarray[index] = myclass;
});
return myarray;
}
var arr_divs = list_div_class();
alert (arr_divs); // there is hidden listed but it's ok
You can do using
.map()tooResult:
Refer LIVE DEMO