A simple tool to store and display texts longer than a few lines.
The search button<div id="xyz">will highlight all</div> the words matching the name of objects that are members of the classes listed in searchedClasses,
itself a member of the KeySet class. The highlighted words are hypertext.
I want to retrieve characters which are surrounded by div-xyz tag.
example output.
....search button will highlight all the words.....
I am able to get the current div tag text by following.
function myDivHTML(valueName){
if((obj = document.getElementById(valueName)) && obj != null){
return obj.innerHTML;
}
}
I tried with offsetParent
property of element - but there are many possibilities like div tag may be inside bold tag & bold tag may be inside p tag & so on.
what should I do to get surrounding text ? limit may be 10, 20 chars.
Edit :
Surrounding text means -> text left side 10 or 20 chars & right side 10 or 20 chars.
Thanks in advance for sharing your knowledge. Sugar.