A measurement of vector boson scattering and constraints on anomalous quartic gauge couplings from events with two Z bosons and two jets are presented. The analysis is based on a data sample of proton–proton collisions at s=13TeV collected with the CMS detector and corresponding to an integrated luminosity of 35.9fb−1. The search is performed in the fully leptonic final state ZZ→ℓℓℓ′ℓ′, where ℓ,ℓ′=e or μ. The electroweak production of two Z bosons in association with two jets is measured with an observed (expected) significance of 2.7 (1.6) standard deviations. A fiducial cross section for the electroweak production is measured to be σEW(pp→ZZjj→ℓℓℓ′ℓ′jj)=0.40−0.16+0.21(stat)−0.09+0.13(syst)fb, which is consistent with the standard model prediction. Limits on anomalous quartic gauge couplings are determined in terms of the effective field theory operators T0, T1, T2, T8, and T9. This is the first measurement of vector boson scattering in the ZZ channel at the LHC.