Added “hasClass:” method to determine if the node has a specific class, and edit other methods to use this method.