如何通过name获取value值?
<!DOCTYPE HTML> <html> <head> <script type="text/javascript"> function word(){ alert(document.getElementsByName("in").value); } </script> </head> <body> <input name="in" type="button" onclick="word()" value="111" /> <input name="in" type="button" onclick="word()" value="222" /> <input name="in" type="button" onclick="word()" value="333" /> </body> </html>
随意点击其中一个按钮,然后获取它的value值,如何才能做到啊?