Getting through the first task

Hello, I’m here again with some good news. I finally completed the first task, I could successfully traverse the DOM with the help of the DOMTraverser class which is a Pre-order depth-first DOM traversal helper. The DOMTraverser is a class that visits every node in the DOM, typically, as you visit the node you will want to do different things depending on the task at hand. The DOMTraverser has methods one of which is the addHandler(nodeName, action). With this method the DOMTraverser will pass a node (the ‘a’ node in…