JS - 动态更改Textfield

Oli*_*nes 4 javascript forms input dynamic

我试图在没有任何提交的情况下从另一个文本字段的值更改一个文本字段中的值.例:

[Textfield 1(类型'你好')]

[Textfield 2(此处也插入'hello')]

以下是我的表格:

<form action="#" id="form_field">
   <input type="text" id="textfield1" value="">
   <input type="text" id="textfield2" value="">
</form>
Run Code Online (Sandbox Code Playgroud)

我对JavaScript了解不多,这有可能吗?非常感谢任何帮助.

谢谢

mic*_*cha 6

<form action="#" id="form_field">
   <input type="text" id="textfield1" value="" onKeyUp="document.getElementById('textfield2').value=this.value">
   <input type="text" id="textfield2" value="">
</form>
Run Code Online (Sandbox Code Playgroud)

看到它在行动:http: //jsfiddle.net/4PAKE/