1<! DOCTYPE html>2"en">34<meta charset="UTF-8">5<title>Document</title>6<script>7Window.onload=function () {8 varAin=document.queryselectorall ('input');9 varAem=document.queryselectorall ('em');Ten varAi=document.queryselectorall ('I'); One for(varI=0; i<ain.length;i++){ A - (function (index) { - if(ain[index].value=='0'){ theDelete localstorage['a'+index]; - } -ain[i].oninput=function () { -Ai[index].innerhtml=parsefloat (aem[index].innerhtml) *parsefloat (ain[index].value); +localstorage['a'+index]=parsefloat (aem[index].innerhtml) *parsefloat (ain[index].value); - + storage (); A }; at - }) (i); - - } - function Storage () { - varArr=[]; in function Findarr () { - for(varNameinchlocalstorage) { to Arr.push (Localstorage[name]); + - } the returnarr; * } $ varD=Findarr ();Panax Notoginseng varp=0; - for(varI=0; i<d.length;i++){ the varP=number (D[i]) +p; +Div1.innerhtml='Total Price:'+p; A } the } + - }; $</script> $ -<body> -<div> the<p> Product Name: Mild feeling Sword spectrum </p> -<input type=" Number"min="0"Value="0">Wuyi<em> -$</em><br><br> the<i></i> - Wu</div> -<div> About<p> Product Name: Nine Yin Sutra </p> $<input type=" Number"min="0"Value="0"> -<em> -$</em><br><br> -<i></i> - A</div> +<div> the<p> Product Name: Taijiquan Spectrum </p> -<input type=" Number"min="0"Value="0"> $<em> -$</em><br><br> the<i></i> the the</div> the<div id="Div1">0</div> -</body> inNative JS implementation of shopping cart prices and Total price statistics