javascript - jQuery dynamic Right-to-Left CSS processing -
i have list might this:
<ul> <li>table</li> <!-- english --> <li>मेज</li> <!-- hindi --> <li>میز</li> <!-- urdu --> </ul>
i want use jquery read characters in list-item , if finds characters in arabic unicode range (0x0600 - 0x06ff), underline it.
here have:
$("li:contains(/[\u0600-\u06ff]/)").css( "text-decoration", "underline" );
it should match third item i'm doing wrong. perhaps regular expressions not allowed :contains
in jquery selectors...
you can use filter()
regexp
.
try following:
var regex = new regexp(/[\u0600-\u06ff]/); $("li").filter(function() { return regex.test($(this).text()); }).css("text-decoration", "underline");
Comments
Post a Comment