使用jQuery获取Textarea的价值 [英] Getting Textarea Value with jQuery
本文介绍了使用jQuery获取Textarea的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这让我发疯-为什么我的代码不起作用?
This is driving me crazy - why doesn't my code work?
<a id="send-thoughts" href="">Click</a>
<textarea id="#message"></textarea>
jQuery("a#send-thoughts").click(function() {
var thought = jQuery("textarea#message").val();
alert(thought);
});
未定义警报.
推荐答案
您有id="#message"
...应该是id="message"
这篇关于使用jQuery获取Textarea的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文