We introduce optogenetic investigation of neurotransmission (OptIoN) for time-resolved and quantitative assessment of synaptic function via behavioral and electrophysiological analyses. We photo-triggered release of acetylcholine or γ-aminobutyric acid at Caenorhabditis elegans neuromuscular junctions using targeted expression of Chlamydomonas reinhardtii Channelrhodopsin-2. In intact Channelrhodopsin-2 transgenic worms, photostimulation instantly induced body elongation (for γ-aminobutyric acid) or contraction (for acetylcholine), which we analyzed acutely, or during sustained activation with automated image analysis, to assess synaptic efficacy. In dissected worms, photostimulation evoked neurotransmitter-specific postsynaptic currents that could be triggered repeatedly and at various frequencies. Light-evoked behaviors and postsynaptic currents were significantly (P ≤ 0.05) altered in mutants with pre- or postsynaptic defects, although the behavioral phenotypes did not unambiguously report on synaptic function in all cases tested. OptIoN facilitates the analysis of neurotransmission with high temporal precision, in a neurotransmitter-selective manner, possibly allowing future investigation of synaptic plasticity in C. elegans.