Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set textbox value to empty(blank) using javascript in facebook

Tags:

javascript

I want to set my textboxes empty(blank) once user posted or skipped feed box in facebook. i m using following code:

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.....

like image 202
user392406 Avatar asked Jul 16 '10 12:07

user392406


People also ask

How do you empty a textbox in JavaScript?

You can use the onfocus attribute in JavaScript to clear a textbox or an input box when somebody sets focus on the field. If you are using jQuery, then use the . focus() method to clear the field.

How do you create an empty value?

To make values empty you can do the following: $("#element"). val('');

What is the value of an empty text box?

when you do not enter anything in INPUT box then its value become UNDEFINED.


1 Answers

Assuming the element you want to change has the id question, so you can do

document.getElementById("question").value = "";
like image 131
John Boker Avatar answered Nov 15 '22 17:11

John Boker