jQuery select ancestor

Try parent() for the immediate parent element. $(“.click-me”).click(function() { var ancestor = $(this).parent(); alert(ancestor) }); Or parents() for all matching ancestor elements. $(“.click-me”).click(function() { var ancestors = $(this).parents(“.some-ancestor”); alert(ancestors) }); Or closest() for the first closest matching element (either an ancestor or self). $(“.click-me”).click(function() { var ancestor = $(this).closest(“.some-ancestor”); alert(ancestor) }); The difference between parents() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)