Latest web development tutorials

HTML DOM 버튼 양식 속성

버튼 객체 참조 버튼 객체

정의 및 사용

버튼 참조를 포함하는 형태로 재산 반환을 형성한다.

버튼을 포함하는 경우, 버튼을 포함하고 있지 않으면 폼 객체는, null을 반환합니다.

문법

buttonObject.form


브라우저 지원

Internet ExplorerFirefoxOperaGoogle ChromeSafari

모든 주요 브라우저 양식 속성을 지원합니다.


다음의 예 복귀 버튼 ID를 속하는 형성 :

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>

<form id="form1">
<button id="button1" type="button">点我!</button>
</form>
<p>含有按钮的表单的ID:
<script>
document.write(document.getElementById("button1").form.id);
</script></p>

</body>
</html>

»시도


버튼 객체 참조 버튼 객체