English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Adjacent sibling selector (+)Selects the element placed after the first specified element (not inside).
Sibling elements must have the same parent element, 'adjacent' means 'immediately following'.
$("prev + next")
Select each <div> element next to the <p> element:
$(document).ready(function(){ $("div + $("p").css("background", "mediumpurple"); });Test and see‹/›
Parameter | Description |
---|---|
prev | Any valid selector |
next | A selector that matches the element next to the first selector |