GENERAL METHOD: 4-Bromo-1H-indazole (1 eq.) was mixed with potassium carbonate (3 eq.) in acetone (15-30 mL) and stirred at room temperature for 30 minutes. Subsequently, iodomethane (1.2-1.8 eq.) was slowly added to the reaction system and the reaction was heated under reflux conditions for 3-8 hours. After completion of the reaction, acetone was removed by evaporation under reduced pressure and the residue was dissolved in ethyl acetate (30 mL). The organic phase was washed with saturated saline (3 x 15 mL), dried over anhydrous magnesium sulfate, filtered and concentrated under reduced pressure. The crude product was purified by silica gel fast column chromatography (eluent: ethyl acetate/cyclohexane, 1:2 or dichloromethane) to afford the target products 4-bromo-1-methyl-1H-indazole and 4-bromo-2-methyl-2H-indazole, respectively.