1.

Which method is not for traversing DOM tree sideways?(a) parent()(b) siblings()(c) prev()(d) nextAll()The question was asked in an interview for job.The origin of the question is Essential JavaScript and jQuery topic in portion HTML Tables, Javascript & Jquery Basics of HTML

Answer»

The correct option is (a) parent()

For EXPLANATION: There are methods for traversing DOM TREE SIDEWAYS. Some of them are NEXT(), prev(), prevAll(), nextAll(), siblings(), prevUntil(), next(). All the sibling elements are returned by siblings() method. The next sibling is returned by next() method. All the next siblings are returned by nextAll() method.



Discussion

No Comment Found

Related InterviewSolutions