HTML DOM 입력 URL 양식 속성은 입력 URL에 대한 둘러싸는 양식의 참조를 반환합니다.
구문
다음은 구문입니다 -
양식 개체에 대한 참조 반환
inputURLObject.form
예시
입력 URL 형식의 예를 살펴보겠습니다. 속성 -
<!DOCTYPE html>
<html>
<head>
<title>Input URL form</title>
<style>
form {
width:70%;
margin: 0 auto;
text-align: center;
}
* {
padding: 2px;
margin:5px;
}
input[type="button"] {
border-radius: 10px;
}
</style>
</head>
<body>
<form id="Larry Page">
<fieldset>
<legend>URL-form</legend>
<label for="URLSelect">URL :
<input type="URL" id="URLSelect" size="25">
</label>
<input type="button" onclick="getform()" value="Get Co-founder">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var inputURL = document.getElementById("URLSelect");
function getform() {
if(inputURL.value !== '')
divDisplay.textContent = 'Co-founder: '+inputURL.form.id;
else
divDisplay.textContent = 'Please enter valid URL';
}
</script>
</body>
</html> 출력
이것은 다음과 같은 출력을 생성합니다 -
'공동 설립자 얻기'를 클릭하기 전에 버튼 -

'공동 설립자 얻기' 확인 후 버튼 -
