2010-07-16 37 views
4

我想設置我的文本框爲空(空白),一旦用戶在Facebook上發佈或跳過提要框。我使用以下代碼:如何設置文本框的值爲空(空白)在Facebook中使用JavaScript

var attachment = { 
     .........some code here............ 
}; 
Facebook.streamPublish('', attachment,actionLinks,null,null,clear); 

} 

function clear() 
{ 
document.getElementById("question").setTextValue() = ""; 
} 

但這不起作用。 請幫我.....

回答

15

假設你想改變的ID爲「問題」,你可以做

document.getElementById("question").value = ""; 
0
JavaScript Code : 

document.getElementById("question").value = "Your value goes here"; 

Jquery Code : 

if it's a simple text 
$("#question").text("Your text goes here"); 

if it's a HTML code 
$("#question").html("Your HTML goes here"); 

if you want to append to the current text value 
$("#question").append("Your text goes here"); 
元素
相關問題