$('#div1').click(function(){ alert('click div1'); }); $('#img1').click(function(e){ alert('click img1'); //e.stopPropagation(); // ① 버블링업 막음(click div1 X) //e.preventDefault(); // ② 기본 동작 막음(링크동작 X) return false; // ③ jquery를 사용하면 위 둘다 제지(click div1 X / 링크동작 X) });
<a href="http://zinee-world.tistory.com" target="_blank"> <div id="div1"> <img src="http://placehold.it/200x100" id="img1"></img> </div> </a>