Why are Earth's oceans salty?
Early history of Earth is a question to paleohydrology and paleochemistry. Briefly, water wasn't pure on the early stages of Earth. 

Brief history of water on Earth. The planet was hot and seismoactive (lots of vulcanos) in the beginning. Water (as steam) escaped from magma, cooled down and precipitated on the Earth's surface. The surface already had salts on it, so it became saline from the very beginning. A better question is: how come we have fresh water in rivers and saline water in oceans? This separation is due to water cycle on our planet. Rivers bring dissolved salts to the ocean, then evaporates and precipitates over the land. Salts cannot evaporate (at any practical rate), so they stay in the ocean. This is similar to washing dishes. Consider this model: dish gets cleaner - that is a river; drain water gets dirtier - that is an ocean; drain water goes through purification and becomes clean before going to the supply pipe - this is evaporation of water from the surface of an ocean and precipitation over the land in our model.