A measurement is presented of electroweak (EW) production of a W boson in association with two jets in proton–proton collisions at s=13Te. The data sample was recorded by the CMS Collaboration at the LHC and corresponds to an integrated luminosity of 35.9fb-1. The measurement is performed for the ℓνjj final state (with ℓν indicating a lepton–neutrino pair, and j representing the quarks produced in the hard interaction) in a kinematic region defined by invariant mass mjj>120Ge and transverse momenta pTj>25Ge. The cross section of the process is measured in the electron and muon channels yielding σEW(Wjj)=6.23±0.12(stat)±0.61(syst)pb per channel, in agreement with leading-order standard model predictions. The additional hadronic activity of events in a signal-enriched region is studied, and the measurements are compared with predictions. The final state is also used to perform a search for anomalous trilinear gauge couplings. Limits on anomalous trilinear gauge couplings associated with dimension-six operators are given in the framework of an effective field theory. The corresponding 95% confidence level intervals are -2.3<cWWW/Λ2<2.5Te-2, -8.8<cW/Λ2<16Te-2, and -45<cB/Λ2<46Te-2. These results are combined with the CMS EW Zjj analysis, yielding the constraint on the cW W W coupling: -1.8<cWWW/Λ2<2.0Te-2.