The present invention provides a composition for sealing an optical device comprising (i) a silylated organopolysiloxane with a polystyrene equivalent weight average molecular weight of 5×104 or greater, represented by an average composition formula:R1a(OX)bSiO(4−a−b) / 2 (wherein, R1 represents an alkyl group, alkenyl group, or aryl group; X represents a combination of a group represented by a formula —SiR2R3R4 (wherein, RE to R4 are monovalent hydrocarbon groups), and an alkyl group, alkenyl group, alkoxyalkyl group or acyl group; a represents a number within a range from 1.00 to 1.5; b represents a number that satisfies 0 b 2, and a+b satisfies 1.00 a+b 2), and (ii) a condensation catalyst, as well as a transparent cured product obtained by curing the composition, and a method of sealing a semiconductor element that comprises a step of applying the composition to a semiconductor element, and a step of curing the composition that has been applied to the semiconductor element. The composition can form a coating film that exhibits excellent levels of heat resistance, ultraviolet light resistance, optical transparency, toughness and adhesion.