Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/420.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将选定单选按钮的值添加到公式中_Javascript_Radio Button - Fatal编程技术网

Javascript 将选定单选按钮的值添加到公式中

Javascript 将选定单选按钮的值添加到公式中,javascript,radio-button,Javascript,Radio Button,我束手无策。我不知道如何将单选按钮的值加到等式中。有人能至少给我一个线索吗 如果我没有单选按钮的功能,这是正常的 <input type="radio" class="InternetCost" name="int" id="no_int" value="0">None<br> <input type="radio" class="InternetCost" name="int" id="ten" value="10">10<br> <inp

我束手无策。我不知道如何将单选按钮的值加到等式中。有人能至少给我一个线索吗

如果我没有单选按钮的功能,这是正常的

<input type="radio" class="InternetCost" name="int" id="no_int" value="0">None<br>
<input type="radio" class="InternetCost" name="int" id="ten" value="10">10<br>
<input type="radio" class="InternetCost" name="int" id="twenty" value="20">20<br>
<input type="radio" class="InternetCost" name="int" id="thirty" value="30">30<br>
None
10
20
30

//尝试选择单选按钮
var值=document.getElementsByName(“int”);
函数getValue(){
对于(变量i=0;i