Check an HTML element is empty using with jQuery

Do something for an empty element found:

jQuery

if ($('#element').is(':empty')){
  //do something
}

//Onclick check element is empty 
$('selector').click(function(){
    if ($('#element').is(':empty')){
      //do something
    }
})
  • Share
  • Copyright 2016 by WebiBeris.com. All Rights Reserved.