Thuộc tính biểu mẫu Email đầu vào HTML DOM trả về tham chiếu của biểu mẫu kèm theo cho Email đầu vào.
Cú pháp
Sau đây là cú pháp -
Quay lại tham chiếu về biểu mẫu đối tượng
inputEmailObject.form
Ví dụ
Hãy để chúng tôi xem một ví dụ về Biểu mẫu email đầu vào tài sản -
<!DOCTYPE html>
<html>
<head>
<title>Input Email 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="Multitech-MNC">
<fieldset>
<legend>Email-form</legend>
<label for="EmailSelect">Employee Email :
<input type="email" id="EmailSelect" value="xyz@abc.com">
</label>
<input type="button" onclick="getform()" value="Confirm Email">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var inputEmail = document.getElementById("EmailSelect");
function getform() {
if(inputEmail.value !== '')
divDisplay.textContent = 'Logging Into: '+inputEmail.form.id;
else
divDisplay.textContent = 'Please enter valid email';
}
</script>
</body>
</html> Đầu ra
Điều này sẽ tạo ra kết quả sau -
Trước khi nhấp vào ‘Xác nhận Email’ nút -
Sau khi chọn ‘Xác nhận Email’ nút -