A search for decays to invisible particles of Higgs bosons produced in association with a top-antitop quark pair or a vector boson, which both decay to a fully hadronic final state, has been performed using proton-proton collision data collected at s=13TeV by the CMS experiment at the LHC, corresponding to an integrated luminosity of 138fb-1. The 95% confidence level upper limit set on the branching fraction of the 125GeV Higgs boson to invisible particles, B(H→inv), is 0.54 (0.39 expected), assuming standard model production cross sections. The results of this analysis are combined with previous B(H→inv) searches carried out at s=7, 8, and 13TeV in complementary production modes. The combined upper limit at 95% confidence level on B(H→inv) is 0.15 (0.08 expected).