I wrote code that shows the whole document's HTML code in a pop-up message:
<label>Hai world...</label>
<p>Test</p>
$(document).click(function(event) {
var text = $(event.target).parent().html();
alert(text);
});
How can I narrow down my code to show me only the specific HTML code of the part which is clicked on, and not the whole document's HTML code?