Ich benutze eine asp.net-Webanwendung und ich habe ein Skript wie folgt.Jquery auf keyup wird nicht ausgelöst
<script>
$(document).ready(function() {
$("#popup input").keyup(function() {
var total = 0;
$(".txtLitAmount").each(function (index, item) {
temp = parseFloat($(item).val());
if (isNaN(temp))
temp = 0
total = total + temp;
});
$("#lblTotal").text(total);
});
});
</script>
Html Teil als.
<div>
<table width="100%" class="table">
<thead>
<tr>
<th>Dimension Code</th>
<th>Dimension Name</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr class="gradeX">
<td>
Dubai Office</td>
<td>
Sales</td>
<td>
<input type="text" value="0.00" id="litAmount_0" class="txtLitAmount"></td>
</tr>
<tr class="gradeX">
<td>
Dubai Office</td>
<td>
Test</td>
<td>
<input name="litAmount" type="text" value="0.00" id="litAmount_1" class="txtLitAmount"></td>
</tr>
</tbody>
</table>
<div style="width: 100%; padding-left: 624px;">
<label style="margin-right: 20px;">SubTotal</label>
<span id="lblTotal" class="lblSubtotal">0.00</span>
</div>
</div>
Wenn ich das Skript auf Browser-Konsole ausführen, funktioniert es. Aber aus Anwendung, feuert es nicht das Key-up-Ereignis, wenn Typ Werte in den Textfeldern. Kann mir jemand helfen? Vielen Dank im Voraus.
ich nur den Code gelesen haben, aber Sie haben keine Element/Container with'id = "Pop-up" ':/ –