How to set textbox value blank (space) using javascript on facebook

I want my text fields to be empty (empty) as soon as the user has posted or skipped the facebook upload field. I m using the following code:

var attachment = { .........some code here............ }; Facebook.streamPublish('', attachment,actionLinks,null,null,clear); } function clear() { document.getElementById("question").setTextValue() = ""; } 

but it does not work. please help me.....

+5
source share
2 answers

Assuming the item you want to change has the identifier question , so you can do

 document.getElementById("question").value = ""; 
+17
source
 JavaScript Code : document.getElementById("question").value = "Your value goes here"; Jquery Code : if it a simple text $("#question").text("Your text goes here"); if it 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"); 
+1
source

Source: https://habr.com/ru/post/1315915/


All Articles