coolplayer37,
или так
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$("ul[id='products1']").filter(":not(:has(li))").html("This <i>unordered list (products1)</i> is <span class='green'>empty</span>");
});
</script>
</head>
<body>
<ul id="products1">
</ul>
<ul id="products1">
<li>test</li>
</ul>
<ul id="products1">
</ul>
</body>
</html>