An action potential in the nerve fibre is produced when positive and negative charges on outside and inside of the axon are reversed because
When a nerve fibre is stimulated, its membrane becomes more permeable to sodium ions, hence more sodium enter the axon than potassium ions leaving it.