JavaScript Hands-on 1

index.html
-
---------------------------------------------------------------------
<!DOCTYPE html>
<htmt>
<head>
<script src="index.js">
</script>
</head>
<body><input type="button" value="show" onclick="callMe()">
</body>
</html>

----------------------------------------------------------------------------
index.js
--------------------------------------------------------------
----------------------------------------------------------------------------
function callMe() {
var Passenger=new Object();
Passenger.name="Arun";
Passenger.age=28;
Passenger.reservedStatus='true';
document.write('<div id="name">'+Passenger.name+'</div>');
document.write('<div id="age">'+Passenger.age+'</div>');
document.write('<div id="reservedStatus">'+Passenger.reservedStatus+'</div>');
}

 

©2018 by The real one. Proudly created with Wix.com