I have three columns, each of them containing a DIV. These DIV's are filled with data but it occasionally happens, that these DIV's are empty and in that case they screw up my layout. Now I want to check if the DIV's are filled with data (html) and if not, to remove them. I made some if-statements but I'm sure this can be done smoother.
Here is my js code:
if ($.trim($(".fcol1").html()) =='') {
$(".fcol1").remove();
}
if($.trim($(".fcol2").html()) == '') {
$(".fcol2").remove();
}
if($.trim($(".fcol3").html()) == '') {
$(".fcol3").remove();
}
So, is there a way to shorten this code?