Aims. We investigate the triggered star formation occurring in the infrared dark clouds (IRDC) G38.95-0.47 between H II regions G38.91-0.44 and G39.30-1.04, and study the detailed morphology, distribution, and physical parameters of the molecular gas and dust in this region. Methods. We present the radio continuum, infrared, and CO molecular observations of IRDC G38.95-0.47 and its adjacent H II regions G38.91-0.44 (N74), G38.93-0.39 (N75), and G39.30-1.04. The Purple Mountain Observation (PMO) 13.7 m radio telescope was used to detect 12 CO J = 1−0, 13 CO J = 1−0 and C 18 O J = 1−0 lines. The carbon monoxide (CO) molecular observations can ensure the real association between the ionized gas and the neutral material observed nearby. To select young stellar objects (YSOs) associated this region, we used the GLIMPSE I catalog. Results. The 13 CO J = 1−0 emission presents two large cloud clumps. The clump consistent with IRDC G38.95-0.47 shows a triangle-like shape, and has a steep integrated-intensity gradient toward H II regions G38.91-0.44 and G39.30-1.04, suggesting that the two H II regions have expanded into the IRDC. Four submillmeter continuum sources have been detected in the IRDC G38.95-0.47. Only the G038.95-00.47-M1 source with a mass of 117 M has outflow and infall motions, indicating a newly forming massive star. We detected a new collimated outflow in the clump compressed by G38.93-0.39. The derived ages of the three H II regions are 6.1 × 10 5 yr, 2.5 × 10 5 yr, and 9.0 × 10 5 yr, respectively. In the IRDC G38.95-0.47, the significant enhancement of several Class I YSOs indicates the presence of some recently formed stars. Comparing the ages of these H II regions with YSOs (Class I sources and massive G038.95-00.47-M1 source), we suggest that YSOs may be triggered by G38.91-0.44 and G39.30-1.04 together, which supports the radiatively driven implosion model. It may be the first time that the triggered star formation has occurred in the IRDC compressed by two H II regions. The new detected outflow may be driven by a star cluster.