Cotton fabric is a cellulose-based material with complex capillary spaces, which enhance breathability and softness. However, these capillary spaces can promote bacterial growth with moisture during storage and daily use. Additionally, cotton fibers are highly flammable, posing a fire hazard to wearer. The lack of inherent antibacterial and flame retardant properties in cotton fabric limits its applications. In this paper, the triazole compound containing Schiff base (NABTA) was synthesized from 3-bromopropene, p-hydroxybenzaldehyde and 3-amino-1,2,4-triazole, followed by an addition reaction between Schiff base activity and 9,10-dihydro-9-oxa-10-phospha-phenanthrene-10-oxide (DOPO) to synthesize an antibacterial and flame retardant precursor (NABTA-DOPO). The structure of NABTA and NABTA-DOPO was characterized by FTIR and NMR. NABTA and NABTA-DOPO were applied to cotton fabrics to investigate and compare their antibacterial properties and thermal stability. The results showed that all the cotton fabrics treated with NABTA and NABTA-DOPO had favorable antibacterial effects. The introduction of DOPO had no significant effect on the antibacterial effect and mechanism of the fabrics. However, it otherwise improved the burning stability of treated cotton fabrics. The antibacterial activity of 10 g/L NABTA-DOPO treated cotton fabrics after chlorination against E. coli and S. aureus was over 99.99 %. The vertical burning test results showed that cotton fabrics treated with a concentration of 50 g/L NABTA-DOPO had improved flame retardant properties with a damaged length of 5.9 cm. In addition, the storage, washability, UV stability and antibacterial reproducibility experiments demonstrated the excellent durability and reproducibility of the N-halamine structure of chlorinated cotton fabrics. This study enhances cotton fabric by synthesizing and applying NABTA and NABTA-DOPO, resulting in improved multifunctionalities, including antibacterial properties, flame retardancy, UV resistance, and wettability.