<ul>
<li>bleep</li>
<li><em>blah</em> blah blah</li>
<li>splat</li>
<li>bloak</li>
</ul> <script src="js/jquery-1.5.1.min.js"></script> <script>
$(document).ready(function() {
$('li:first-child').click(function(){
alert("li:first-child - " + $(this).text());
});
$('li:last-child').click(function(){
alert("li:last-child - " + $(this).text());
});
$('li:first-of-type').click(function(){
alert("li:first-of-type - " + $(this).text());
});
$('li:last-of-type').click(function(){
alert("li:last-of-type - " + $(this).text());
});
$('li:only-child').click(function(){
alert("li:only-child - " + $(this).text());
});
$('li:only-of-type').click(function(){
alert("li:only-of-type - " + $(this).text());
});
$('em:first-child').click(function(){
alert("em:first-child - " + $(this).text());
});
$('em:last-child').click(function(){
alert("li:last-child - " + $(this).text());
});
$('em:first-of-type').click(function(){
alert("em:first-of-type - " + $(this).text());
});
$('em:last-of-type').click(function(){
alert("em:last-of-type - " + $(this).text());
});
$('em:only-child').click(function(){
alert("em:only-child - " + $(this).text());
});
$('em:only-of-type').click(function(){
alert("em:only-of-type - " + $(this).text());
});

});
</script>