Re: [jQuery] Select part of text and add a CSS class

2010-01-18 Thread Nathan Klatt
On Mon, Jan 18, 2010 at 6:02 AM, Mircea wrote: > I am trying to create my first jQuery script. I want to have a text in > a , select it with the cursor and add a class to it. I know that I > can use the .select and .addClass functions. I bet you need to wrap the selected text in a span - you can'

[jQuery] Select part of text and add a CSS class

2010-01-18 Thread Mircea
Hi, I am trying to create my first jQuery script. I want to have a text in a , select it with the cursor and add a class to it. I know that I can use the .select and .addClass functions. $("p").live("mouseup", function() { selection = getSelectedText(); if(s