0
好了,所以我有这样的:如何使用Jquery从动态创建的textarea获取文本?
$('a[name=writecommentsmodal]').live('click',function(e) {
e.preventDefault();
var date=new Date();
var currdate=date.getYear()+" "+date.getMonth+" "+date.getDate();
var comm=new addComment("",fullname,currdate,$ ***("#inputspace2").text()) ***;
comm.appendComment($(".wallpostcontainer"));
});
而且我想从inputspace2文本。当按钮被按下时(这个按钮是'a [name = writecommentsmodal]'),会动态地创建inputspace2。该按钮也恰好是通过不同的按钮点击动态创建的(因此使用直播),但我离题了。当我点击模式按钮时,inputspace2.text是空的。我如何访问它?在萤火虫它的“”。我想也许不得不再次使用直播,但我不是
两者都应该为textarea工作 - http://jsfiddle.net/FloydPink/rANgJ/ –
@FloydPink当用户修改textarea的内容时,只更新'value'属性。 **请参阅[Fiddle](http://jsfiddle.net/rANgJ/2/)** –
我查看过,当我看到您的详细答案并且您是对的 - http://jsfiddle.net/FloydPink/rANgJ/ 1/ 谢谢... –