Résumé : A study of the production of prompt mesons contained in jets in proton-proton collisions at is presented. The analysis is based on data corresponding to an integrated luminosity of 19.1 fb−1 collected with the CMS detector at the LHC. For events with at least one observed jet, the angular separation between the meson and the jet is used to test whether the meson is part of the jet. The analysis shows that most prompt mesons having energy above 15 GeV and rapidity are contained in jets with pseudorapidity . The differential distributions of the probability to have a meson contained in a jet as a function of jet energy for a fixed energy fraction are compared to a theoretical model using the fragmenting jet function approach. The data agree best with fragmenting jet function calculations that use a long-distance matrix element parameter set in which prompt mesons are predicted to be unpolarized. This technique demonstrates a new way to test predictions for prompt production using nonrelativistic quantum chromodynamics.