/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$.fn.equals = function(compareTo) { if (!compareTo || !compareTo.length || this.length!=compareTo.length) { return false; } for (var i=0; i<this.length; i++) { if (this[i]!==compareTo[i]) { return false; } } return true; } /* USAGE: element.equals(target);
Comments
