<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
alert($("li").length);
});
});
</script>
</head>
<body>
<button>Alert the number of li elements</button>
<ul>
<li>Coffee</li>
<li>Milk</li>
<li>Soda</li>
</ul>
</body>
<!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_prop_length by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:06:32 GMT -->
</html>