관리 메뉴

nkdk의 세상

JS :: 링크클릭시 외곽점선 숨김 본문

My Programing/HTML and JavaScript

JS :: 링크클릭시 외곽점선 숨김

nkdk 2008. 6. 16. 10:28

  • srcElement : 이벤트를 발생한 객체를 반환합니다.
  • getAttribute() : 해당객체의 속성값을 반환합니다.

  • target : 새로운 창(프레임)의 이름을 설정합니다.
  • window.open(url, 이름, 속성) : 새 창을 엽니다.
  • window.lacation : 해당 URL을 반환하거나 지정합니다.

<html>
<script language="JavaScript">
<!--

function jumpto() {
if (event.srcElement.getAttribute("target") == null)
  window.location = event.srcElement.url
else
  window.open(event.srcElement.url, event.srcElement.getAttribute("target"))
}

// -->
</script>
<body>

<div url="http://www.naver.com" onclick="jumpto()" style="cursor:hand; color:blue;">
네이버로 이동하기
</div>

</body>
</html>