Hi all,
Can anyone of you comment on this.
I want to create a simple text hilighter. Say in a label I've some text, and if I select some text on that and on a click event I want bold the seleced text permanatly. At the time text is on a DB, so I can added any html tags there.
I've use a simple JS to get selected text, but it working only on IE, not in FF. And also I'm stuck with that how to get the index of selected text to add tags.
Comments really helpful.
<script language="javascript" type="text/javascript">
function getSel()
{
var txt = '';
alert(txt);
if (document.selection && document.selection.createRange)
{
txt = document.selection.createRange().text ;
//alert(str);
}
else if (document.getSelection)
...
Go to the complete details ...