Objective To observe the effect of midazolam oral liquid for relieving preoperative anxiety on the postoperative recovery of gastrointestinal function in children.Methods Ninety children undergoing laparoscopic high ligation of hernia sac in oblique inguinal hernia were equally divided into two groups of A and B with 45 cases each.The children in group A were given midazolam oral liquid 0.5 mg/kg 30 minutes before surgery,and those in group B were given 5%glucose solution with the same dose.The first exhaust and defecation time after surgery,intake,feeling nauseated,emesis,physical examinationand duration of symptoms(I-FEED)score,modified Yale Preoperative Anxiety Scale-short form(mYPAS-SF)score,parents's State-Trait Anxiety Inventory(STAI)score,Ramsay sedation score,parent-child separation score,Post-Hospital Behavior Questionnaire(PHBQ)score,FLACC pain score and doctor's satisfaction were compared between the two groups.Results Compared with group B,the first exhaust and defecation time after surgery was shortened,I-FEED score in the 1st day after surgery was decreased,mYPAS-SF scores at leaving waiting area,walking to the operating room and before anesthesia induction and parents's STAI score at leaving waiting area were decreased,and Ramsay sedation score and parent-child separation score at leaving waiting area were increased in group A(P<0.05).There were no statistical differences in the FLACC pain score and PHBQ score in the 1st,2nd and 3rd day after surgery between the two groups(P>0.05).The doctor's satisfaction score in group A was higher than that in group B(P<0.05).Conclusion The use of midazolam oral liquid can effectively relieve the anxiety before surgery,promote the postoperative recovery of gastrointestinal function in children.