我想要在我的JQuery按鈕元素以外的目標div。我現在這樣做的方式是目標在我的Jquery按鈕元素以外的div
$(this).parent().parent().parent().parent().parent().parent().parent().children(":nth-child(3)").children().children().children(":nth-child(4)");
必須有更簡單的方法嗎?該元素有一個類,但也有更多相同的元素,我也需要單獨調整。
謝謝。
CODE: https://jsfiddle.net/n71mgmgw/
我們需要看到這個代碼的情況下,所以請您可以粘貼您的HTML代碼片段 – jacqbus
通過解釋您當前正在使用的DOM結構來解釋您正面臨的場景和實際需求 –
https:// j sfiddle.net/n71mgmgw/ – TellJohn