I am trying to find all the elements of engagement_app which have ids and which do not have ids. What is wrong with the below code? It cannot find the ones with/without ids
jQuery('.engagement_data').each(function() {
var engagement_app = $(this).find(".engagement_app").val();
//if ($(this).find(".engagement_app").attr('id'))
if ($(this).find(".engagement_app").is('[id]'))
{
console.log("in if1")
console.log($(this).find(".engagement_app").attr('id'));
}
if ($(this).find(".engagement_app").not('[id]'))
{
console.log("id not found")
}
});