1、getElementsByName(name)该方法与 getElementById() 方法相似,但是它查询元素的 name 属性,而不是 id 属性。区别就是getElementById只能获得一条内容,因为一个页面id是唯一的(不唯一也行,但是不能使用javascript等脚本了)。