Copy link to clipboard
Copied
Hi,
as you can see on the here included image, below "Ihr Profil", there are 10 items provided by a webapp which are customized in the details.htm page as an unordered list.
In this case there are only 6 items filled out, the rest is empty, but the empty items do appear. Is it possible to tell the details page, not to display those empty items?
Thanks a lot for your interest and help
1 Correct answer
There are ways to do this with jQuery, but an easier way would be to use CSS.
ul li:empty {
display: none;
}
Though this will not work in IE8/7, if that is a deal breaker you will need to use jQuery: http://jsfiddle.net/F7ZWV/
$("ul li").each(function() {
var $this = $(this);
if($this.text() == ""){
$this.remove();
}
});
Copy link to clipboard
Copied
There are ways to do this with jQuery, but an easier way would be to use CSS.
ul li:empty {
display: none;
}
Though this will not work in IE8/7, if that is a deal breaker you will need to use jQuery: http://jsfiddle.net/F7ZWV/
$("ul li").each(function() {
var $this = $(this);
if($this.text() == ""){
$this.remove();
}
});
Copy link to clipboard
Copied
Chad, it works, thank you so much
