HTML DOM 숨겨진 양식 속성
정의 및 사용
숨겨진 입력 필드에 대한 참조를 포함하는 형태로 재산 반환을 형성한다.
이 속성 반환 개체를 형성한다.
문법
hiddenObject.form
브라우저 지원
모든 주요 브라우저는 양식 속성을 지원
예
예
다음의 예는 숨겨진 입력 필드가 양식 아이디에 속하는 반환
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">显示表单form的id</button>
</body>
</html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("hidden1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<input type="hidden" id="hidden1">
</form>
<button type="button" onclick="displayResult()">显示表单form的id</button>
</body>
</html>
»시도
숨겨진 개체