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.