Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nextSibling & previousSibling in YUI

Tags:

javascript

yui

Is there any way to get nextSibling and previousSibling of an element in YUI3? Just like there is :

node.get('parentNode');

where node is some node in the DOM.

like image 989
user_newbie Avatar asked Feb 27 '26 10:02

user_newbie


2 Answers

You want .next() and .previous()

http://developer.yahoo.com/yui/3/api/Node.html#method_next
http://developer.yahoo.com/yui/3/api/Node.html#method_previous

like image 180
Tivac Avatar answered Mar 01 '26 01:03

Tivac


The documentation suggests that node.get("nextSibling") and node.get("previousSibling") are what you need.

like image 38
Tim Down Avatar answered Mar 01 '26 01:03

Tim Down



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!