getAttribute:取得属性; setAttribute:设置属性。 input.setAttribute("title"); 当它是一个值,就是取值。input.setAttribute("title", "hello");那这个自然就是设置值了。 人如代码,规矩灵活;代码如诗,字句精伦。