Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions array.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<body>
<form>
<h3>Here is the 1st array</h3><br>
<h3>1 3 5 7 9 </h3><br>
<h3>1 3 5 7 9 11</h3><br>
<h3>Here is the 2nd array</h3><br>
<h3>2 4 6 8 10</h3><br>
<h3>2 4 6 8 10 12</h3><br>
<h3>Click Submit to interchange the values</h3>
<button onclick="swap();">SUBMIT</button>
</form>
<script>
var arr1 = ["1","3","5","7","9"]
var arr2 = ["2","4","6","8","10"]
var arr1 = ["1","3","5","7","9","11"]
var arr2 = ["2","4","6","8","10","12"]
function swap()
{
var i,temp;
for (i=0;i<5;i++)
for (i=0;i<6;i++)
{
temp = arr1[i];
arr1[i] = arr2[i];
Expand All @@ -41,4 +41,4 @@ <h3>Click Submit to interchange the values</h3>
}
</script>
</body>
</html>
</html>