Getting selection. Check documentation: getSelection() method