A new possible method

Recently I've needed to compare if two fields were distinct before submit my form, I found this solution and I thought interesting if it was a native method.

Sorry if already exists some way to do this, but I really not found in docs.