A technology for the implementation of electrically tunable optical elements is presented. We illustrate, on the example of a transmission grating (TG), that dielectric elastomer actuators can be used to continuously adjust the properties of diffractive optical elements. The demonstrated TG operates with high transmission, low optical distortion (<lambda/20), high damage threshold (> 93 kW/cm(2)), is polarization-independent, and achieves a very large tuning range (7.5% grating period compression). Extending the presented technology to other optical elements, including lenses, phase shifters, or intensity filters, is expected to result in a wide range of electrically tunable optical devices.