<!DOCTYPE HTML>
<html>
<head><meta charset="windows-1251" /> </head>
<body>
<input name = "first" />
<input name = "first" />
<input name = "first" />
<br>
<input name = "second" />
<input name = "second" />
<input name = "second" />
<button>push</button>
<script>
first=document.getElementsByName("first")
second=document.getElementsByName("second")
test=function(){
for(var i=0; i<3; i++){if(first[i].value!=second[i].value) return alert(false)}
alert(true)
}
document.querySelector("button").onclick=test
</script>
</body>
</html>