2012-03-07 112 views
0

我有1個輸入字段。按用戶輸入設置輸入值

<input id="post_remote_posted_url" type="text" size="30" name="post[remote_posted_url]"> 

我怎麼能去從這個字段輸入填充值,當我去打字,這個領域裏面寫什麼呢?

+2

你能舉一些例子嗎? – 2012-03-07 12:57:45

+0

你能解釋一下你需要多少?您在輸入內容時要求填寫輸入內容,這是它的功能。你想要價值來填充不同的領域? – Archer 2012-03-07 12:59:37

+0

我沒有找到任何示例:(。我希望當用戶在輸入字段中輸入屬性'value =「」'時,該字段將填充用戶寫入的文本。 – hyperrjas 2012-03-07 13:02:17

回答

2

你的意思是這樣的:http://jsfiddle.net/6MurG/

$("#post_remote_posted_url")​.keyup(function(){ 
     $(this).attr("value",$(this).val()); 
    })​ 
+0

Yeahhh,這是修復:D。謝謝! – hyperrjas 2012-03-07 13:13:07