Alex Rivera | Logout

How can I convert a jQuery object to an Element?

Asked 2011-04-04T01:33:40.647
40

If I have a textarea like var textarea = $('textarea'), how can I set the value to it using the JavaScript property value, and not the jQuery property val()?

I think I need to convert textarea to a JavaScript object first, but how do I?

Edit
Report

1 Answer

6

You can pull the HTMLElement using array notation:

$('textarea')[0].value

...will get the value of the first element in the $('textarea') jQuery list.

answered 2011-04-04T01:36:11.487

Your Answer