User:Sd.md.hosseini

Knowing the text selected using mouse in javascript

1 down vote favorite 2 I my application i want to make the text seleected selected using mouse bold..How to do this using javascript? Also how to know the cursor position using javascript...For example ,i may need to insert a text using my function just before the text where cursor is placed