开发者

getting value from hidden textarea with jquery

开发者 https://www.devze.com 2023-03-18 19:27 出处:网络
I would l开发者_高级运维ike to know how to retrieve the value of a textarea box that was initially hidden but when a checkbox is ticked it reveals the textbox for input. I have posted my code here:

I would l开发者_高级运维ike to know how to retrieve the value of a textarea box that was initially hidden but when a checkbox is ticked it reveals the textbox for input. I have posted my code here:

http://jsfiddle.net/RF5PK/

many thanks


Generally, using val():

$('textarea[name="setmessage"]').val();

Here's a demo.

Although, from the code sample, I get the impression there's more to this question than meets the eye!


Try this

$('textarea[name="setmessage"]').val();


http://jsfiddle.net/RF5PK/4/ see this i have only used needed jquery for your question. And I have added contactmessage class to your text area.

0

精彩评论

暂无评论...
验证码 换一张
取 消