Check if the selected element contains white space
I am trying to check if the element is empty.
My element could be something like
<table>
<td> </td>
<td> </td>
<td> </td>
<td>text</td>
</table>
I have tried:
$('table td').each(function(){
if($(this).is(':empty')){
console.log('found;)
}
})
and
$('table td').each(function(){
if($(this).html()==' '){
console.log('found')
}
})
but I can't seem to find it. Anyway I can accomplish this? Thanks a lot!
No comments:
Post a Comment