WD Labfile-2
WD Labfile-2
<i nput type="number" id="age" name=="age" placeholder="Enter age" required min=" 18"
max="60">
<label for="gender">Gender:</label>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
<label for="course">Course:</label>
</div>
<script>
// Validate Name
if (name.length< 3) {
valid = false;
// Validate Email
if (!emailRegex.test(email)) {
valid = false;
II Validate Age
con st age = document.getElementByld('age').value.trim();
r:
f
Valid== false·
'
valid = false ,·
if ( !phoneRegex.test(phone)) {
t = "Phone numb er must be 10 digits.";
docu ment .getE leme ntByl d('ph oneE rror') .textC onten
valid = false;
}
if (!valid) {
});
</scr ipt>
</bo dy>
</htm l>
7
Shraddha Mehrotra
Email:
Age :
20
Gender:
V
Female
Course :
BCA
Phone Number:
9 · W rt tt n g pro9r11m
In )( M l for creatio
n o f OTO, w h ich
rules . sp e d fl e s set oi
' 7 ,m l ve rs io
n = "1.0 " st nnd alono --
< tO O C T Y P E d oc "yes"? >
um en 1 l
'-1E L E M E N T
do cu m e nt (o m p
''E L E M E N T om lo ye e r >
p lo yco (n am e , hi
< •E LE M E N T na rada te)>
m e (lastn arne , nr
<f E L E M E N T la st stname) >
na m e (#PCDATA
<! E L E M E N T first )>
name (#PCDATA
<! E L E M E N T l1ire )>
date (#PCDATA)>
J>
< d o cu m e n t>
< e m p lo ye e >
<na me>
< la st na m e> K el ly
< /la st na m e>
< fi rs tn a m e > G ra
ce < /f ir st na m e>
< /n a m e >
< h ire d a te > O ct o
b e r 1 5 , 20 05 < /h
ir ed at e>
< /e m p lo ye e >
< e m p lo ye e >
<name>
< la st n a m e > G ra
n t< /la st n a m e >
< fi rs tn a m e > C a ry
< /f ir st n a m e >
</name>
< hiredate >Octobe r 20, 2005 </hireda
te>
< /e m p lo ye e >
<e m p loyee>
<:na me >
<= la stname>Gab le
< /last name >
c"' firstnarne >Clark <
/firstname >
<.: /name >
<hireda te >Octorio r 25, 20
05 .--Jhi mdate >
<: /employee >
</document> /
//
/
OUTPUT:
lh" \\II - ..
til, d,-.·, no t ;JJ'Pt';t, I1,l\ •·
1" .ir,,. ,;tvl<' 111form~t1on a<:~orrait•d \\1th II The dor um<"nt tri·,· 1•, ,;how n L,,., I11
"
►'d ly
(1r ,l( t"
Gr,1n t
fary
.
Gabl e
Clar k
index.xm/
nt.css
employee {
color: white;
background-color : gray;
width : 100%;
}
name {
color: green;
font-size : 40px;
background-color : powderblue;
display : block;
}
phone {
font-size : 25px;
font-weight: bold;
}
OUTPU
T:
'-"" 1 0 ., m l
K e l ly G
:• hhi •i-l ► race
fi!IDE
G r a nt C
:•:&M t!-iXt ary
tiiliiJ
Gable C
larl<.