选择选项不能单独工作 [英] select option doesn't work separately
本文介绍了选择选项不能单独工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在给定的小提琴链接中,当我单击电子邮件或电话部分中的绿色加号按钮时,它将创建一个新的输入字段.当我想从下拉菜单中选择一个选项时,还要在所有下拉菜单中选择该选项.
In the given fiddle link, when I click on the green plus button in email or phone section it create a new input field.when I want to select an option from a dropdown menu it also select option in all dropdown menu.
*需要单独使用工作下拉菜单.
*need to work dropdown menu separately.
*在单击下拉菜单的文本时需要选择单选按钮.
*need to select radio button when click on text of dropdown menu.
推荐答案
您必须使用ul旁边的按钮标签才能工作,但我认为这就是您想要的方式!
you have to use button tag next to ul to work, but I think this is wath you want!
$(document).on("click", 'a.radio_click', function(){
var param = $(this).attr("href").replace("#","");
var concept = $(this).text();
var span = $(this).closest("ul").prev().find("span#search_concept");
span.text(concept);
$(this).find('input').prop('checked', true);
$('.input-group #search_param').val(param);
});
您必须删除
$('.search-panel .dropdown-menu').find('a').click(function()
这是不必要的.
这篇关于选择选项不能单独工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文