DEV Community

mhsohag11
mhsohag11

Posted on

Answer: jquery if div id has children

You can also check whether div has specific children or not,

if($('#myDiv').has('select').length>0)
{
   // Do something here.
   console.log("you can log here");

}

Top comments (0)