I am trying to test which parts of a page are clicked. Is there a jQuery function that can show the path of the element that is being clicked? I have searched Google but have not come across anything that has worked for me. Is event.target.className
correct to use for this?
Code:
<script type="text/javascript">
$(document).ready(function() {
$("body").click(function(event) {
window.alert("clicked: " + event.target.nodeName);
});
});
</script>