我是 jQuery 的新手。我已经编写了一个代码来将产品从一个表添加到另一个表中,就像这样动态检查FIDDLE
:正如您在小提琴中看到的那样,此代码对我来说工作正常。
现在我通过使用 ajax 动态生成此产品列表(表 2)来操作此代码,现在此代码对我不起作用..
当我想到这个缺陷时,我认为我的所有 CSS 和 JS 脚本都随着页面的加载而加载,但是这个复选框(表 2)动态加载,这就是为什么 JS 没有娱乐这个......
那么如何在动态加载的输入字段上触发事件函数......只希望这个脚本得到改进: JQUERY 1.6.4
这是我的观点:
<div class="_25">
<?php echo form_dropdown('class', $dropdown_class,'','id="clas"'); ?>
</div>
<div class="_25">
<?php echo form_dropdown('section',$dropdown_section); ?>
</div>
<table class="table" border="1">
<thead><tr>
<th>Select</th>
<th>Cause</th>
<th>Monthly Charge</th>
</tr></thead>
<tbody id="selectedServices"></tbody>
<tr>
<td>Total-</td>
<td>Fee</td>
<td id="total">1500</td>
</tr>
</table>
<!-- product list (will generate dynmiclly)like tble 2 in fiddle -->
<table id="abcd" class="table" border="1">
<thead><tr>
<th>Select</th>
<th>Cause</th>
<th>Monthly Charge</th>
</tr></thead>
<tbody …
Run Code Online (Sandbox Code Playgroud)