I have one html div on my jsp page, on that i have put one anchor tag, please find code below for that,
put your jquery function inside ready function for call click event:
$(document).ready(function() { $("#ancherComplaint").click(function () { alert($(this).attr("id")); }); });