I am trying to figure out how to make a text box number reflect the number on the array i am trying to show. My code in attached. I am trying to make it that if i type "4" then 4 of my skills would pop up on my site.
<script type="text/javascript">
function myduties1() {
var a= document.getElementById("DNumber1").value;
var duties1= ["Building Houses","Using Heavy Machinery","Lifting","Fixing","Working Fast"];
var b= a-1
var c=""
while (a>=b) {
c== "duties1[b]";
b++;
}
document.getElementById("mduties1").innerHTML =c;
}
</script>
<p><button onclick="myduties1()">Click Here</button>to see my top <input type="text" id="DNumber1" value=""> job duties</p>
<p id="mduties1"></p>