Consider there’s a table with rows to which a td with class x is added by jQuery on the fly (during DOM manipulation). Later when the user submit’s this table (table being part of a form), i want to search all the rows for existence of this particular td. If this td is found then the function should return false, else true. However this piece of code does not work, any suggestions?
function validate(){
$('form#newuser table tr').each(function(){
if($(this).find('td.x')){
return false;
}
});
return true;
}
$(<selector>).lengthreturns the number of DOM elements matched by the<selector>.