기존보던창을 네이버로 새탭은 다음으로

html에서

href 와 target은 이해하고있으나

기존의 보던 창은 네이버로 새탭은 다음으로 이동하고싶은데

어떻게 코드를 짜야할까요

|

답변 1개

html만으로는 안되구요. jquery로 클릭이벤트 잡아서 새창 먼저 띄우고 현재창 이동시켜면 될거같네요.

<script>

$(document).ready(function(){

    $('a.link').click(function(){

        window.open('http://daum.net');

        location.href = 'http://naver.com';

    })

})

</script>

답변을 작성하려면 로그인이 필요합니다.