-
마우스 우측클릭 context menu function에서 요소 id 받기개발 공부/Spring 2022. 3. 21. 10:37반응형
javascript jquery로 context menu 만들었을 때 html 요소 id 가져오기
callback: function(key,opt){ alert(opt.$trigger.attr("id")); //opt.$trigger.attr("name")); removeIcon(opt.$trigger.attr("id")); } }
여기서 key는 context menu item 이름이고
opt가 우측클릭한 요소
위 소스로 이름, 아이디를 가져올 수 있음
반응형'개발 공부 > Spring' 카테고리의 다른 글
sts/eclipse setter gettter 어노테이션 자동 생성 lombok 적용하기 (0) 2022.03.29 STS lombok 적용 안될 때 (0) 2022.03.29 [STS 4] 프로젝트에 에러 빨간 느낌표 해결 , cannot be resolved to a type 해결 방법 (0) 2022.03.18 a jni error has occurred please check your installation and try again 오류 해결법 (0) 2022.03.18 Spring Boot Thymeleaf 외부 로컬 이미지 출력하기 , 프로젝트 경로에 파일 업로드 (0) 2022.03.17