Chemical functionalization of two-dimensional transition metal dichalcogenides (TMDs) with hydrogen is an effective and economical method to synthesize monolayer TMDs and tune their electronic properties. We theoretically study the stabilities and electronic properties of chemisorbed H atoms on monolayer TMDs by using density-functional theory calculations. The result shows that there exists a more stable adsorption site in the layers of the monolayer MX2 (M=Mo, W; X=S, Se, Te) than its surface for hydrogen. In the case of the same cation, with the increase of the anion (X2-) atomic number, the stronger the bonding between the H atom and the MX2 layer, the more stable the structure of the hydrogenated monolayer MX2 is. However, in the case of the same anion, the binding between the H atom and the MX2 layer becomes weaker as the atomic number of the cations increases. H atoms passes through one surface of the MS2 to the other surface with a relatively small diffusion barrier of about 0.9 eV. So the H atoms can more easily go through the barrier. And for the H atom to go through the other monolayer MX2 (M=Mo, W; X=Se, Te), the diffusion barrier is about 1.2 eV. H atoms are difficult to pass through the barrier at this time. The singular diffusion behavior of H atoms in monolayer MX2 is conducible to understanding the stability of hydrogenated two-dimensional transition metal sulfide system. In addition, the surface hydrogenation and interlaminar hydrogenation have different effects on the electronic properties of monolayer MX2, and mainly manifest themselves in the fact that the surface hydrogenation induces spontaneous magnetism and sharply reduces the band gap, but still retains the semiconductor properties of the original monolayer MX2. However, interlaminar hydrogenation enables monolayer MX2 to directly realize the transition from semiconductor to metal. Interlaminar hydrogenation monolayer MX2 (M=Mo, W; X=S, Se) make the system generating magnetism, while when the anion is Te2-, the magnetism almost disappears. These results can provide theoretical guidance in understanding hydrogen functionalization of MX2 layer, and also present a certain theoretical basis for realizing the application of MX2 in nano-electronic devices.