form reset 초기화
1.폼에 id 값을 지
<form name="form_apply" id="form_apply" method="post" action="?tpf=sub/process" enctype="multipart/form-data">
2. 스크립트 선언
function form_reset() {
document.getElementById("form_apply").reset();
}
3. 실행 버튼
<img class="closebt" onclick="form_apply_reset();form_reset()" src="/html/images/closebt.svg">
출처:http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_form_reset
Tryit Editor v3.6
Enter some text in the fields below, then press the "Reset form" button to reset the form. First name: Last name: function myFunction() { document.getElementById("myForm").reset(); }
www.w3schools.com
'개발 > javascript' 카테고리의 다른 글
구글 마커 안나옴 Error InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama (0) | 2021.03.31 |
---|---|
페이지 접속시 자동으로 탭 클릭하고 지정 영역으로 스크롤 이동 (0) | 2021.03.11 |
facebook 링크 공유 javascript (0) | 2021.02.26 |
javascript form list 추가 삭제 (0) | 2021.01.20 |
html display none script 컨트롤 (0) | 2021.01.19 |
댓글