I have an array $t
with HTML elements:
I need to execute a function on elements that have class row
(2 elements).
Right now, I'm trying to filter elements with hasClass
method but receive the following mistake:
hasClass(...).each is not a function
How can I iterate over the array and get elements with row
class?
Here is my code:
var $t = $(this).siblings('div');
console.log($t);
$t.hasClass("row").each(function(){
...
})
UPDATE
I've changed a code a bit:
var _t = $(this).siblings('div.row');
console.log('t ' + _t);
_t.each(function( index, value ){
console.log('value ' + value);
var checkboxes = value.find('input[type="checkbox"]');
console.log(checkbox);
checkboxes.trigger( "click" );
})
Now, I'm receiving the following error:
value.find is not a function