This may be illegal in California where employers must share their range and cannot ask candidates their salary history.
Employers can't ask candidates their salary history, but they can definitely ask the candidate for salary expectations.
[1] CA Labor Code Section 432.3 (c) An employer, upon reasonable request, shall provide the pay scale for a position to an applicant applying for employment. For purposes of this section, “pay scale” means a salary or hourly wage range. For purposes of this section “reasonable request” means a request made after an applicant has completed an initial interview with the employer.
The reality is many people aren’t at the liberty of strictly choosing employers; and labor laws help raise pay for everyone at the detriment of corporations and investors b