Marko
Marko

Reputation: 10992

Why is my text not showing in my textarea?

I have a textarea where I change some text and insert it with some javascript code, but it isn't showing up. I can see it through firebug, that it's there but on the screen I can't see anything. Any ideas?

Yeah, I don't think it's a problem in my js-code. It can be with some styling issues or something.

<textarea rows="4" cols="50" name="ta_eftertext" id="ta_eftertext">Bajskorv Aftertext hello world! </textarea>

JSfiddle example!!!

Upvotes: 0

Views: 1955

Answers (2)

Kostia
Kostia

Reputation: 6304

This should work:

html:

<textarea id="textArea">
</textarea>​

and js:

$('#textArea').val('text');

Upvotes: 1

kannix
kannix

Reputation: 5157

You can use jQuery .text like this:

$('#ta_eftertext').text("foo");

http://jsfiddle.net/kannix/ZEjN7/

Upvotes: 0

Related Questions