Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at


This method functions identically to the Window.getSelection() method; it returns a Selection object representing the text currently selected in the document.

Document Tags and Contributors

 Contributors to this page: teoli, Sheppy, kscarfone, Khodaidad_Basharmand, ethertank, RobG
 Last updated by: teoli,