<!DOCTYPE html>
<head>
<title></title>
<style>
.row {
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 0%;
}
.row::after{
display: table;
clear: both;
content: "";
}
.col-12{
width: 100%;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="row">
<div class="col-12">
<form>
First Name:<input id="fName" type="text" placeholder="Enter your first name">
<br>
Last Name:<input id="lName" type="text" placeholder="Enter your lirst name">
<br>
Students id:<input id="stuId" type="number" placeholder="Enter your student id">
<br>
Country Designation:
International student<input id="cDesig" type="checkbox" >
</form>
</div>
<div class="col-12">
<form>
<input type="image" src="fName.jpg" value="First Name" onclick="FANME()"><br>
<input type="image" src="lName.jpg" value="Last Name" onclick="LNAME()"><br>
<input type="image" src="stuId.jpg" value="Student's Id" onclick="STUID"><br>
<input type="image" src="countrydesig.jpg" value="Country Designation" onclick="CDESIG()">
<br><br><button onclick="Output()">RETRIEVE</button>
</form>
</div>
<div class="col-12">
<form>
<h2 id="output">
</h2>
</form>
</div>
</div>
<script>
function FNAME(){
var fName=document.getElementById('fName');
document.write(fName.value);
event.preventDefault();
}
function LNAME(){
var lName=document.getElementById('lName');
}
function STUID(){
var sId=document.getElementById('stuId');
}
function CDESIG(){
var temp=document.getElementById('cDesig');
var cDesig="";
if(temp.checked){
cDesig="International Student";
}
else{
cDesig="Domestic Student";
}
}
function Output(){
var out=document.getElementById('output');
var fName=document.getElementById('fName');
var lName=document.getElementById('lName');
var sId=document.getElementById('stuId');
var temp=document.getElementById('cDesig');
var cDesig="";
if(temp.checked){
cDesig="International Student";
}
else{
cDesig="Domestic Student";
}
out.innerText="First Name:"+fName.value+"\nLast Name:"+lName.value+"\nStudent Id:"+sId.value+"\nCountry Designation:"+cDesig;
event.preventDefault();
}
</script>
</body>
Get Answers For Free
Most questions answered within 1 hours.