Click here to Skip to main content
14,845,769 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:[^]

I have created a fiddle for my question , In the fiddle i have a paragraph as
" ,Ajax, Jquery,Javascript" , If i select only Ajax from those text and Click print button ,then it should show only the Ajax. How do i do that?
Kornfeld Eliyahu Peter 21-Apr-15 9:36am
Where the JavaScript code is?
King Fisher 22-Apr-15 4:18am
i don't know which method should use.
Kornfeld Eliyahu Peter 22-Apr-15 4:24am
I didn't got you...
King Fisher 22-Apr-15 5:39am

1 solution

There is nothing in jQuery to handle it for you...
however plain JavaScript can help here - but of course IE before version 9 has all the problems you can get...
The key for this is getSelection()[^] method of the window object...

Updated jsFiddle:[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900