チェックボックスがオンになっている合計値を印刷しようとしています。既に動作してinput type="checkbox">
いますが、asp:checkbox/> でコードを作成しています。
試してみましたが print NaN です。
次のコード: 4 つのチェックボックス
<asp:CheckBox runat="server" ID="CheckBox1" Text="Mobile" Value="70" onclick="checkcount(this);" />
<asp:Label ID="lbltotal" runat="server" ClientIDMode="Static"></asp:Label>
int amount=0;
function checkcount(item)
{
amount += parseInt(document.getElementById(item.id).value);
alert(amount);
document.getElementById("lbltotal").innerHTML = amount;
}