我正在编写一些函数来简化我与Javascript节点的交互,这是目前为止的源代码:Node.prototype.getClasses=function(){returnthis.className?this.className.split(""):"";};Node.prototype.hasClass=function(c){returnthis.getClasses().indexOf(c)>=0;};Node.prototype.addClass=function(c){if(!this.hasClass(c)){this.className+=""+c;}returnthis;