The ocean waters were not salty from the start. There are various reasons, which took place for millions of years before the sea turned salty. One reason states that fresh water is being turned to salty water as a result of various factors and that has led to the present condition of sea. Rain water during its passage through the atmosphere absorb many salts, chemicals and gases. Due to the presence of gases such as carbon dioxide, rain water becomes a acidic in nature. When the rain water falls on the rocks, the acid errodes the rocks and carry them with it in the form of ions. This rain water is carried to the oceans through rivers or streams and gets accumulated there. Millions of years needs to pass before these ions make a significant contribution to the salinity of sea. The process by which rain water permeates through the soil and absorb salts and minerals is known as weathering.
In addition to this, many of the rocks also contain basic salt, i.e Sodium chloride in large quantities. When rivers or rain water flows over them, it carries a significant amount of salt from such rocks which later gets accumulated in the sea.

click to enlarge