Code:
<ul>
<li>Does the UL contain an LI?</li>
</ul>
Jquery :
<style type="text/css">
.full
{
border: 1px solid red;
}
</style>
<script>
$(document).ready(function () {
$("ul").append("<li>"+($("ul").has("li").length?"YES":"NO")+"</li>");
$("ul").has("li").addClass("full");
});
</script>
Done :)
<ul>
<li>Does the UL contain an LI?</li>
</ul>
Jquery :
<style type="text/css">
.full
{
border: 1px solid red;
}
</style>
<script>
$(document).ready(function () {
$("ul").append("<li>"+($("ul").has("li").length?"YES":"NO")+"</li>");
$("ul").has("li").addClass("full");
});
</script>
Done :)
Comments
Post a Comment