기본 구문의 예
<button>Click here</button>
HTML button 버튼 양식 내에서 중첩
1 2 3 4 5 6 7 8 9 | <form action= "/html_5/tags/html_form_tag_action.cfm" method= "get" target= "_blank" > First name: <input type= "text" name= "first_name" maxlength= "100" > Last name: <input type= "text" name= "last_name" maxlength= "100" > <button type= "submit" >Submit</button> </form> |
HTML button 이미지와 버튼
1 2 3 4 | <button onclick= "JavaScript:alert('You will love this book!')" > <img src= "/pix/web_graphics/free_website_graphics/icons/books/book13.gif" alt= "Read book" > Read Book!</button> |
HTML button 파알다운로드 버튼 링크
<a href="http://사이트이름/quot.zip"><button>Download Test</button></a>
HTML button 버튼링크 처리
팝업창으로 띄우기
onclick=”window.open(‘페이지’,’win’,’윈도우 팝업 옵션’)”;
<input type=”button” name=”버튼” value=”테스트” onclick=”window.open(‘#,’win’,’width=350,height=250,toolbar=0,scrollbars=0,resizable=0′)”;>
새창으로 띄우기
onclick=”window.open(‘페이지’)”;
<input type=”button” name=”버튼” value=”테스트” omclick=”window.open(‘#‘)”;>
현재창으로
onclick=”location.href=’페이지'”;
<input type=”button” name=”버튼” value=”테스트” omclick=”location.href=’#“;>
프레임이 있을때
onclick=”parent.프레임명.location.href=’페이지'”;
<input type=”button” name=”버튼” value=”테스트” onclick=”parent.프레임명.location.href=’#“;>
참고로 아이프레임에서 프레임이 있을 때(parent 더 추가)
onclick=”parent.parent.프레임명.location.href=’페이지'”;
<input type=”button” name=”버튼” value=”테스트” onclick=”parent.parent.프레임명.location.href=’#“;>