The action principle for fields was introduced in article 11475. This article introduces the action principle for electrodynamics in flat spacetime.