![Stack Overflow](http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png)
here is my basic code. I just need to print the value entered by the user. However, it returns undefined. Please help. Thanks in advance.
<html>
<head>
<title>Element by name</title>
<script>
// using getElementsByName() method
function msg(){
var v=document.getElementsByName("name1");
alert("Yo...