Created
October 19, 2012 01:32
-
-
Save mmuchin/3915770 to your computer and use it in GitHub Desktop.
Chrome script to compare two elements values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(a,b){ | |
var aComputed = getComputedStyle(a); | |
var bComputed = getComputedStyle(b); | |
console.log('------------------------------------------'); | |
console.log('You are comparing: '); | |
console.log('A:', a); | |
console.log('B:', b); | |
console.log('------------------------------------------'); | |
for(var aname in aComputed) { | |
var avalue = aComputed[aname]; | |
var bvalue = bComputed[aname]; | |
if( aname === 'length' || aname === 'cssText' || typeof avalue === "function" ) { | |
continue; | |
} | |
if( avalue !== bvalue ) { | |
console.warn('Attribute ' + aname + ' differs: '); | |
console.log('A:', avalue); | |
console.log('B:', bvalue); | |
} | |
} | |
console.log('------------------------------------------'); | |
})($0,$1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment