我有以下代码:CSS - 家长孩子选择不工作
.recipe
.ingredients
= f.simple_fields_for :ingredients do |ingredient|
= render 'ingredient_fields', f: ingredient
.row#links
.col-xs-12
= link_to_add_association "", f, :ingredients
%hr
我需要选择的$("#links")["closest"](".recipe > .ingredients")
格式使用jQuery的成分DIV但这不选择任何内容。
这很令人沮丧,因为$("#links")["closest"](".recipe > .row")
将返回正确的div。
捣鼓什么工作,我想:https://jsfiddle.net/yL6dr4s1/
你能不能给我们呈现的HTML是什么样的想法?也许JSFiddle的例子? – Seano666
@ Seano666对不起,我忘了加入一个链接,我已经添加了! - https://jsfiddle.net/yL6dr4s1/ –
是你的问题关于jquery或关于如何喂这个选择器到茧? – nathanvda