Two-dimensional CrI3 has attracted much attention as it is reported to be a ferromagnetic semiconductor with a Curie temperature of around 45 K. By performing first-principles calculations, we find that the magnetic ground state of CrI3 is variable under biaxial strain. Our theoretical investigations show that the ground state of monolayer CrI3 is ferromagnetic under compression, but becomes antiferromagnetic under tension. Particularly, the transition occurs under a feasible in-plane strain of around 1.8%. Accompanied by the transition of the magnetic ground state, CrI3 undergoes a transition from magnetic-metal to half-metal to half-semiconductor to spin-relevant semiconductor when the strain varies from -15% to 10%. We attribute these transitions to the variation of the d-orbitals of Cr atoms and the p-orbitals of I atoms. Generally, we report a series of magnetic and electronic phase transitions in strained CrI3, which will help both theoretical and experimental researchers in further understanding the tunable electronic and magnetic properties of CrI3 and its analogs.