
AYUDA por favor, sumar resultados de Childs
Publicado por diego (6 intervenciones) el 10/09/2016 23:20:34
Estoy aprendiendo a programar, quiero hacer una caja registradora, ahora mi problema es que cuando creo elementos quiero que las cantidades se vayan sumando para cobrar el total, espero me puedan ayudar. Esto es lo que he hecho por mi cuenta. Saludos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
function agregar (){
var lugar = document.createElement("div");
var concepto = document.createTextNode("Sencillo Germano ");
var precio = document.createTextNode(49);
var currentDiv = document.getElementById("div1");
lugar.appendChild(concepto);
lugar.appendChild(precio);
document.body.insertBefore(lugar, currentDiv);
}
</script>
</head>
<body>
<input type="button" value="Agregar" onclick="agregar()">
<div id="div1"></div><br>
<label>Importe Total: </label><br>
<label>Impuestos Incluidos: </label><br><br>
<input type="radio" name="método de pago" checked>01 - Efectivo
<input type="radio" name="método de pago">03 - Tajeta de Crédito/28 - Débito<br>
<input type="text" placeholder="Cantidad recibida"><br><br>
<input type="button" value="Cobrar" onclick="">
</body>
</html>
Valora esta pregunta


0