I am playing with Regular Expressions in Javascript (see here) and I have stumbled upon some difficulties trying to match <li>
elements. My Css looks like this:
<div id="ResultTabContent" class="TabContent DetailsTabContent">
<div class="DetailsTabContent">
<ul>
<li> <strong>Title:</strong>
Text Title
</li>
</ul>
I have written some Javascript that detects the Unicode range in which Text title is written and, depending on the range, uses the PUA (private use area) from a custom font. This works fine with classes, as follows:
$(document).ready(function() {
$('h2.ClassName').each(function(index, DOMElement){
if(/[\uE000-\uF8FF]+/.test($(DOMElement).text())) {
$(this).removeClass('ClassName').addClass('ClassNameNonRoman');
}
})
});
However I cannot let it work for UL inherited elements. What it makes that difficult is the fact that there are no classes associated to the <li>
elements.
Any idea?
Cheers, I.