Removing Default Field Value

in Script development
Subscribe to Removing Default Field Value 4 posts, 3 voices



Ikviens User

Dear Forum,

How do I remove the default value from a textbox when it is defined by the following HTML?

(textarea name="Area0" rows="4" cols="80")
Here; gibberish that I don't need.
(/textarea)

Please replace parentheses with < and >.

 
Arvid Scriptwright

var myTextArea = $x("//textarea[@name='Area0']")[0]; //this is your textarea
myTextArea.textContent = "";

 
alien_scum Scriptwright

To use Arvid's elegant code you need to include the $x function form the standard library post

 
Ikviens User

Works perfect! Thanks Arvid and alien. :)