01.
<html>
02.
<body>
03.
<input type=
"text"
name=
"test"
id=
"test"
value=
"txt1"
/><br/>
04.
<input type=
"button"
onClick=
"testing();"
value=
"test"
>
05.
<script>
06.
function
testing(){
07.
var
test = document.getElementsByName(
'test'
);
08.
var
test2 = document.getElementsByName(
'test2'
);
09.
var
arr =
new
Array();
10.
for
(
var
i=0; i<test.length; i++) {
11.
12.
13.
arr[i] = (test)[i].value;
14.
}
15.
test2.value = arr;
16.
}
17.
</script>
18.
<input type=
"text"
name=
"test2"
id=
"test2"
value=
""
/><br/>
19.
</body>
20.
</html>