Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM Input Email form Property
The HTML DOM Input Email form property returns the reference of enclosing form for input Email.
Syntax
Following is the syntax −
Returning reference to the form object
inputEmailObject.form
Example
Let us see an example of Input Email form property −
<!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>
Output
This will produce the following output −
Before clicking ‘Confirm Email’ button −

After checking ‘Confirm Email’ button −

Advertisements