I just started out on jQuery and want to use it to solve this problem: I have a list of email addresses from different domains currently residing inside divs. Using .each(), want to loop through each email addresses and only pick out those that do not have the domain ‘@gmail.com’. In other words, somebody@yahoo.com gets appended to another div, file somebody@gmail.com does not. How can I do this?
jQuery
Currently the code simply grabs all emails but does no filtering
$('.email_address').each(function() {
$(this).html().appendTo('#filtered_email_address');
});
Pretty simple:
If you specifically want to filter them, try this: