2010-07-16 40 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"); 
元素
相关问题