var textRange = document.body.createTextRange();
textRange.collapse(true);
if( textRange.findText(tex)) {
textRange.execCommand("BackColor", false, "yellow");
}
上記のコードは、テキストを検索して IE で強調表示するのに最適ですが、出現回数もカウントするように少し修正したいと思います。以下のように
textRange.findText(tex).WhichMethod() Should i use to return me count of occurrences.