Javascript 如何在facebook中使用javascript将文本框值设置为空(空白)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3264848/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 03:57:21 来源:igfitidea点击:
how to set textbox value to empty(blank) using javascript in facebook
提问by user392406
I want to set my textboxes empty(blank) once user posted or skipped feed box in facebook. i m using following code:
一旦用户在 facebook 中发布或跳过提要框,我想将我的文本框设置为空(空白)。我使用以下代码:
var attachment = {
.........some code here............
};
Facebook.streamPublish('', attachment,actionLinks,null,null,clear);
}
function clear()
{
document.getElementById("question").setTextValue() = "";
}
but this is not working. please help me.....
但这不起作用。请帮我.....
回答by John Boker
Assuming the element you want to change has the id question, so you can do
假设您要更改的元素具有 id question,那么您可以这样做
document.getElementById("question").value = "";
回答by Pinkesh Sharma
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");

