Why does this simple thing not work in Internet Explorer 9? (works in FireFox)
var total = 0;
$("input[id=anzahl_feld]").each(function() {
var anzahl = parseInt($(this).val());
if(!isNaN(anzahl))
{
total += Anzahl;
}
});
alert(total);
Thanks!
You want quotes around the id field
But since ids are unique (or at least they should be), why not simply do
If you actually do have multiple inputs with the id of
anzahl_feldthen that’s probably why IE is choking. You cannot have multiple elements with the same id