Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.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
获取值、文本和div内容javascript_Javascript_Jquery_Radio Button - Fatal编程技术网

获取值、文本和div内容javascript

获取值、文本和div内容javascript,javascript,jquery,radio-button,Javascript,Jquery,Radio Button,我的按钮中有以下javascript代码 $“按钮确认”。单击“确认”功能{ $.ajax{ 键入:“post”, url:'index.php?route=付款/租赁计划/确认', cache:false, 数据:{ egn:$'input-payment-egn'.val, 月数:$输入[名称=月数]:已选中.parent.text }, 发送前:函数{ $‘按钮确认’。按钮‘加载’; }, 完成:功能{ $‘按钮确认’。按钮‘重置’; }, 成功:功能{ 地点=; } }; }; 我想从这

我的按钮中有以下javascript代码

$“按钮确认”。单击“确认”功能{ $.ajax{ 键入:“post”, url:'index.php?route=付款/租赁计划/确认', cache:false, 数据:{ egn:$'input-payment-egn'.val, 月数:$输入[名称=月数]:已选中.parent.text }, 发送前:函数{ $‘按钮确认’。按钮‘加载’; }, 完成:功能{ $‘按钮确认’。按钮‘重置’; }, 成功:功能{ 地点=; } }; };

我想从这个部门获取数据

<div id="uni18" class="leasecond">
<input type="text" style="border: none; background: repeat;" readonly />Разсрочено плащане с UNI Credit, вноски 18 x обща дължима сума:
以及单选按钮中的文本和值

<div class="radio">
    <label><input type="radio" name="months" value="uni18"  />18 месеца x </label>
    </div>
怎样才能做到呢? 谢谢大家!

我是这样做的:

months: $('input[name=months]:checked').parent().text() + $('input[name=months]:checked').val()

输入是否在div中?请您发布正确的HTML代码好吗?这会有很大帮助。是的,它在div中,我现在就编辑这个问题。你能澄清你发布的第一个代码块吗?断章取义是的,我会做的,现在有了意义。所以你想从选中的单选按钮中获取文本和值,对吗?