[jQuery][Javascript] Getting attribute of a parent node $(this).parentNode.attr('class') Getting attribute of a parent node $(this).parentNode.attr('class') jquery와 plain javascript를 섞어 섰다는것.. java 사용해서 백엔드단만 작업하다보니 전혀 생각못했던 부분이었다.. jquery를 사용하는곳이 아직 많기 때문에 해당부분을 유의해서 코드작업을 해야할것 같다. // jQuery $(this).parent().attr('class'); // Vanila Javascript this.parentNode.getAttribute("class"); attr() 메서드와 getAttribute()메서드 .attr() 메서드 .attr(attributeName) .attr(attributeName,value) 선택한요소의 속성의 .. 2022. 1. 1. 이전 1 다음