By Melvin Dev
<nav>
<ul>
<li><a href='#'>Navigation 1 </a></li>
<li><a href='#'>Navigation 2 </a></li>
<li><a href='#'>Navigation 3 </a></li>
</ul>
</nav>
<article>
<p>Write your Name </p>
<input type='text' id='nametxt' />
<p>Write your Last Name</p>
<input type='text' id='lastnametxt' />
<p>Age</p>
<select id='ageselect'> </select>
<p id='personinfo'> </p>
<input type='button' id='showinfobtn' onclick='showInfo()' value='Show Info' />
<script>
var getName = document.getElementById('nametxt');
var getLastName = document.getElementById('lastnametxt');
for (var i = 0; i < 80; i++) {
var ageOption = document.createElement('option');
ageOption.text = i;
this.ageselect.add(ageOption);
};
this.ageselect.selectedIndex = 7;
function showInfo() {
this.personinfo.innerText = 'Hello ' + getName.value
+ ' ' + getLastName.value + ' you are ' +
this.ageselect.selectedIndex + ' years old';
}
</script>
</article>