我需要能夠輸入輸入並在另一個輸入中顯示該值,這就是我一直在處理的內容。所以基本輸入從userreplymessage
去輸入userreplydisplay
。如何使用jquery將輸入值從一個輸入轉移到另一個輸入值
HTML
<form id="userreply">
<select id="usernames">
<option value="">Users</option>
<option value="Alex">Alex</option>
<option value="Jeff">Jeff</option>
<option value="Amy">Amy</option>
<option value="Kate">Kate</option>
</select>
<input id="userreplymessage" type="text" />
<input id="userreplydisplay" type="text" />
</form>
jQuery的
$(document).ready(function() {
function update() {
$('#userreplydisplay').text('startreply ' + 'middlereply ' + $('#usernames').val() + ' endreply ' + $('#userreplymessage').val());
}
$('#userreplymessage').keyup(update);
$('#usernames').change(update);
});
你的問題是什麼?什麼不起作用? – jfriend00 2012-03-06 08:12:15
當我輸入'userreplymessage'輸入什麼都沒有出現在'userreplydisplay'輸入字段 – jeff 2012-03-06 08:14:15