显示四个或更多要购买的物品及其相应的购买价格(使用复选框来选择您要购买的物品)。将复选框命名为 item_0、item_1 等。包括一个总计字段,该字段会在每个项目被选中/取消选中或指定数量发生变化时自动汇总您的购买。将此字段命名为总计。
我需要一些帮助。
这是迄今为止我能做的最简单的代码。
<h3> Cart </h3>
<input type = "checkbox" id = "item_0" name ="item_0" value = "Malt">
<label> Beta Malt </label>
<input type = "checkbox" id = "item_1" name ="item_1" value = "bread">
<label> A1 Bread </label>
<input type = "checkbox" id = "item_0" name ="item_2" value = "noodles">
<label> Indomie </label>
<input type = "checkbox" id = "item_0" name ="item_3" value = "milk">
<label> Cowbell </label>