Fix for comparing numeric attributes in JavaScript