We study the control of electron localization in the dissociation of H2+ using three laser pulses by numerically simulating the time-dependent Schrödinger equation. First, we use an attosecond pulse to excite the wave packet of H2+ from 1sσg to 2pσu. Then, two-color femtosecond pulses (800 nm+400 nm) are used to control the dissociation of H2+. By manipulating the phases of two femtosecond pulses, the electron localization can be controlled effectively. For the proper laser parameters, the maximal probability that the electron is located on the selective nucleus is up to 90%. This theoretical scheme can be realized by the state-of-art laser technology.