How to retrieve the position of selected text by calculating it\'s offset immediate after body tag?
For Example consider the following html,
Use following java script function for Highlighting the html page..
function stylizeHighlightedString()
{
var range = window.getSelection().getRangeAt(0);
var selectionContents = range.extractContents();
var span = document.createElement("span");
span.appendChild(selectionContents);
span.setAttribute("class","uiWebviewHighlight");
span.style.backgroundColor = "red";
span.style.color = "white";
range.insertNode(span);
}