Using a food processor fitted with the grater blade, grate onion and potatoes. This can also be done by hand. Keep potatoes in cold water while you work so they don't turn brown.
Squeeze out as much excess water as possible.
In a large bowl mix potato and onion mixture with eggs, flour, if using, salt, and pepper. Mix well.
Heat an inch of oil in skillet. Lower flame so oil doesn't overheat and place a spoonful of the batter into sizzling oil and gently press to flatten with the back of the spoon. Fry for approximately 5 minutes then flip and cook the other side for 2-3 minutes or until golden brown.
Drain excess oil from latkes on paper towels or brown paper bags. Continue cooking remaining batter, adding more oil as necessary.
Serve with hot with applesauce or sour cream.