Below is the sample usage of the code.
Now selText will contain the value of the selected items text.
Do you like this article? Help us to improve. Please post your comments below.