$(document).ready(function() {
var $postBG = $('.post .poster-profile img');
$postBG.find("[title='male']")
.closest('tr')
.addClass('male')
.children('td')
.removeClass('row1 row2');
$postBG.find("[title='female']")
.closest('tr')
.addClass('female')
.children('td')
.removeClass('row1 row2');
});
Just trying to find if the img title is female or male, and then do the following codes above. I tried
$postBG.attr("male")
that did not work though any help please
findfinds the elements within the context of the selected element, you can usefiltermethod:or
attributeselector instead: