Wednesday, March 14, 2018

Make all duplicate text as italic from whole DOM Elements






<script>

   //var Topiclist = new Array();
   //$(".diaRadioTab .underdevtopics").each(function (index) {
   //    var topic = $(this).text();
   //    if (topic != "" || topic)
   //        Topiclist.push(topic);
   //});
   //for (var i = 0; i < Topiclist.length; i++) {
   //    var topicName = Topiclist[i];
   //    var str = document.body.innerText;   // OR    $('body').text();
   //    var re = new RegExp(topicName, 'gi');
   //    var n = str.match(re);
   //    if (n != null) {
   //        var Count = n.length;
   //        if (Count > 1)
   //        {
   //            var ele = $("span").filter(function () { return ($(this).text() === topicName) });
   //            if(ele!=undefined || ele!="undefined" || ele!=null)
   //            $(ele).css("font-style", "italic");
   //        }
   //    }
   //}
</script>

No comments:

Post a Comment

javascript Filter/index off

 var family = [{"name":"Jack",  "age": 26},               {"name":"Jill",  "age"...