Preparation and application of line leaf inula flower lactone A for treating myocarditis having a structure ofThe compound shows positive therapeutic activity against Coxsackie virus and significant dose dependent correlation. The line leaf inula flower lactone A prevents disease in mouse models of experimental autoimmune myocarditis and onset of the process by intraperitoneal injection of a dose of 20 mg/kg/d. When increased to 100 mg/kg/d, the line leaf inula flower lactone A shows positive therapeutic effect on EAM. Line leaf inula flower lactone A is used as the sole active ingredient and combined with a conventional pharmaceutical carrier in a drug for treating myocarditis, and the pharmaceutical composition may be in the form of tablets, dispersible tablets, mouth collapse tablets, retard tablets, capsule, soft capsule, dropping pill, granules, injection, powder injection, or aerosol.