父对象的jquery选择器

父对象的jquery选择器,jquery,selector,parent,children,Jquery,Selector,Parent,Children,我有这个html结构: <div class="dropdownedit"> <div class="dropbtn">textxyz</div> <div class="dropdown-content" style="display: none;"> <div href="#" class="ocond" id="text1">text1</div> <div href="#" class="ocond" id="

我有这个html结构:

<div class="dropdownedit">
<div class="dropbtn">textxyz</div>
<div class="dropdown-content" style="display: none;">
<div href="#" class="ocond" id="text1">text1</div>
<div href="#" class="ocond" id="text2">text2</div>
<div href="#" class="ocond" id="text3">text3</div>
<div href="#" class="ocond" id="text4">text4</div>
</div></div>
我还尝试:

$(this).parents('.dropdownedit').siblings('.dropbtn').text("conditionvalue");
但我没有成功。有人能给我指一下正确的选择器吗?提前谢谢

使用
$(this).parent()
.ocond
导航到
.dropdown内容
,然后您可以使用
.sibbing('.dropbtn')
访问
。dropbtn
同级:

$('.ocond')。在('click',function()上{
$(this).parent()同级('.dropbtn').text(“conditionvalue”);
});

textxyz
文本1
文本2
文本3
文本4

在类“ocond”的同一点击事件中,我想添加另一个同级“text5”。我试过:$(this.parent().prepend(“”+oldcondition+“”);但选择者似乎错了。你知道正确的吗?
$(this).parents('.dropdownedit').siblings('.dropbtn').text("conditionvalue");