<button>태그 링크

2017. 3. 22. 13:38HTML/예제

1. <button>태그에 링크거는 방법


-1) 현재창에 띄우는 방법

<button type="button" onclick="location.href='url' ">버튼내용</button>

<input type="button" name="button" value="내용" onclick="location.href='url'">


-2) 새창에서 띄우는 방법

<button type="button" onclick="window.open('url')">버튼내용</button>

<input type="button" name="button" value="버튼내용" onclick="window.open('url')">


-3) 팝업창에서 띄우는 방법

<button type="button" onclick="window.open('url','win','width=500,height=500,toolbar=0,scrollbars=0,resizable=0')">버튼내용</button>

<input type="button" name="button" value="버튼내용" onclick="window.open('url','win','width=500,height=500,toolbar=0,scrollbars=0,resizable=0')">


-4) 프레임에 출력하는 방법

 <button type="button" onclick="parent.프레임명.location‎.href='url'";>버튼내용</button>

<input type="button" name="button" value="버튼내용" onclick="parent.프레임명.location‎.href='url'";>




'HTML > 예제' 카테고리의 다른 글

7. 픽셀 아트  (0) 2017.08.22
03. Table  (0) 2017.02.20
02. Hyper Link  (0) 2017.02.20
01. Hello, World!  (0) 2017.02.20