2010-08-09 5 views
1

양식이 있는데 제출시 표시되지 않도록하고 싶습니다. 어떻게 가능합니까? :)JavaScript를 사용하여 HTML 조각을 삭제하는 방법

<body> 
<form method="POST" action="test.php" name="_navn"> 
<input name="txt" id="input" type="text" value="Write here" onFocus="noValue()" onBlur="changeValue()"> 
<input type="submit" value="Submit"> 
<input type="hidden" name="_submit_check" value="1"> 
</form> 
</body> 

숨겨진 입력을 제출할 때 나가기를 원하는 것입니다. 방법? :)
(<body> 태그는 내가 삭제하고 싶은 부분의 일부가 아닙니다.)

답변

3

페이지에서 양식과 그 안의 모든 것을 원하십니까?

var f = document.getElementsByTagName('form')[0]; 
f.parentNode.removeChild(f); 

그렇지 않으면 당신은

f.style.visibility = 'hidden' 

또는

f.style.display = 'none'; 
으로 숨길 수 있습니다
관련 문제