Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.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
Jquery 如何在(ALL)单选按钮中获得两个单选按钮值,注意ALL在我的代码中是单选按钮 这就是代码 全部的 从车站 翻腾_Jquery_Codeigniter 2 - Fatal编程技术网

Jquery 如何在(ALL)单选按钮中获得两个单选按钮值,注意ALL在我的代码中是单选按钮 这就是代码 全部的 从车站 翻腾

Jquery 如何在(ALL)单选按钮中获得两个单选按钮值,注意ALL在我的代码中是单选按钮 这就是代码 全部的 从车站 翻腾,jquery,codeigniter-2,Jquery,Codeigniter 2,我想启动一个查询,该查询将有助于在所有单选按钮中获取第二个和第三个按钮的值。如何执行此操作您可以使用jQuery库的eq()方法来执行此操作。请记住,eq()方法使用的DOM元素的索引从0开始。 要获取第二个输入的值,我们需要调用索引号1 This the code <label class="opetionLabel"> <input class="col-4 optionStyle" type="radio" name="selec

我想启动一个查询,该查询将有助于在所有单选按钮中获取第二个和第三个按钮的值。如何执行此操作

您可以使用jQuery库的eq()方法来执行此操作。请记住,eq()方法使用的DOM元素的索引从0开始。 要获取第二个输入的值,我们需要调用索引号1

This the code

<label class="opetionLabel">
                    <input class="col-4 optionStyle" type="radio" name="select_all" value="all">  All.
                    </label>

                    <label class="opetionLabel">    
                    <input class="col-4 optionStyle" type="radio" name="select_all" value="From Station" > From Station 
                    </label>

                    <label class="opetionLabel">    
                    <input class="col-4 optionStyle takeClass" type="radio" name="select_all" value="ToStation ">  ToStation 
                    </label>
$(document).ready(function(){
    var second = $('input[name=select_all]').eq(1).val();
    var third = $('input[name=select_all]').eq(2).val();
    alert(second);
    alert(third);
});