作者knives ()
看板Ajax
标题[问题] jQuery的each跟 live怎麽合在一起用
时间Fri Sep 2 15:02:19 2011
我的HTML是这样的
<textarea id="do_127_70" class="t_input"
rows="1" name="message"></textarea>
我希望在每个t_input後面增加一个div
所以我用下面的写法
$('.t_input').each(function(){
$(this).after('<div class="for_cal"
id="for_cal_'+$(this).attr('id')+'">'+$(this).val()+'</div>');
});
但是现在遇到另外一种情形
我有另外一个已经写好的function 透过它会另外产生一个
textarea,同样都是带着t_input的class
我要怎麽让这个後来产生的textarea的後面,再增加div
在不修改原有的function 的情况下,来增加div
谢谢回答
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.126.209.219
1F:推 kerash:要动态产生? 有触发什麽事件吗?? 09/02 16:05
2F:→ kerash:另外可以丢出两个 function 的 code 吗 09/02 16:05