http://www.iamcal.com/publish/articles/js/google_highlighting/
這裡的代碼是google做的關鍵字高亮的
js文件也可以在http://code.iamcal.com/js/google_highlighter.zip下載
老大讓用下面的htm調用google.js,實現div標簽中的文字根據輸入的關鍵字高亮,怎麼做?
我自己寫的函數比google的簡潔多了,也能實現這個功能。
但老大非讓用google的DOM樹的遞歸做,怎麼用啊?<form>
輸入關鍵字:
<input type="text" id="key" size="10">
<br>
<input type="button" onclick="se()" value="加亮">
<script src="google.js">
</script>
<div id="content">
等搜索的文章

</div>
</form>