views:

171

answers:

2

Hi Techies@StackOverFlow, i am researching on a logic, by which i can select a text in a single right mouse click. What I want to say is that , I want to implement, the double click text selection, but in a other way that is in single click and right click.

For example if you double click on the text displaying anywhere on this web, the text will get selected. Similar thing i want to implement. I prefer Javascript as i am implementing it on web.

Please help me

Amit

+1  A: 

Do one thing write event handler for right click and inside it call your double click function which should select the text.

I haven't tested it but this might work.

Ravia
Hi Ravia, Thanks for your kind support, actually you did'nt got me properly. I need the logic for selecting the text. I know the double click leds to the selection of text, but it is handled by some windows function and i dont know that function, which is called on mouse double click. So how can i call that method, or piece of code of windows.
Amit Ranjan
I think this is going to be the most challenging question ever asked in stackoverflow.
Amit Ranjan
Still waiting for answer...
Amit Ranjan
A: 

It should be fairly simple. Just detect whether or not it is a right click via the onclick method and the event code (2 in this case) in Javascript - if it is, then do the necessary code to select the text (it varies from the IE family to the rest of the real browsers). Should be all you need to do.

James Thomas