Highlighting text beween custom tags
Posted
by Rachel
on Stack Overflow
See other posts from Stack Overflow
or by Rachel
Published on 2010-04-20T15:36:26Z
Indexed on
2010/04/20
15:43 UTC
Read the original article
Hit count: 217
In a xhtml, i want to highlight the text between two self closing tags s1 and s2 whose attribute value is the same. Eg. <s1 ind="1"/>
and <s2 ind="1" />
Eg.
<html>
<body>
<a>
<b>
Some <s1 ind="1"/> text
></b>
<c>
data <s2 ind="1"/>
here</c>
</a>
</body>
</html>
I want "text data" to get highlighted. Is is possible to achieve using javascript/jquery? I could have many such self closing tag pairs s1 and s2 with a unique value for "ind" for the pair indicating that the text within them needs to be highlighted.
© Stack Overflow or respective owner