Как сложить два значения?
Помогите, пожалуйста!
Не могу понять как сложить между собой числа выводимые при помощи <output id="rezultatRAD">10</output> и <output id="rezultatCBX">1</output> в зависимости от положения radio и checkbox вот сам скрипт <input type="radio" name="RAD" value="10" checked="checked"/> <input type="radio" name="RAD" value="20"/> <input type="radio" name="RAD" value="30"/> <input type="radio" name="RAD" value="40"/> <br/> <input type="checkbox" name="CBX" value="1" checked="checked"/> <input type="checkbox" name="CBX" value="2"/> <input type="checkbox" name="CBX" value="3"/> <input type="checkbox" name="CBX" value="4"/> <br/> <output id="rezultatRAD"></output> <output id="rezultatCBX"></output> <script> window.onclick = function onclickRadio() { var RAD = document.getElementsByName('RAD'); for (var i = 0; i < RAD.length; i++) { if (RAD[i].type === 'radio' && RAD[i].checked) { rezultatRAD= RAD[i].value; } } document.getElementById('rezultatRAD').innerHTML = rezultatRAD; var CBX= document.getElementsByName('CBX'); for (var i = 0; i < CBX.length; i++) { if (CBX[i].type === 'checkbox' && CBX[i].checked) { rezultatCBX= CBX[i].value; } } document.getElementById('rezultatCBX').innerHTML = rezultatCBX; } </script> |
|
moron,
а почему не подключен jQuery? он же нужен для сложения чисел ![]() |
Цитата:
|
Цитата:
function calc(par) { var summ = (range[0] + СУММА/1200) * range[0] * range[1]) / range[1], ..... |
animhotep,
Они троллят там или реально так думают? Насчет jQ? |
Часовой пояс GMT +3, время: 10:24. |