I have made a small program that search value from a div...it show first location of the word But i want to make that searched word highligheted after pressing search button at all repeated location..
<html>
<head>
<style type="text/css">
#searchdiv{background-color: #999999;left: 277px;margin: 39px 0 0 84px;padding:5px;width:500px;align:center;}
</style>
<script type="text/javascript">
function search()
{
var keyword=document.getElementById("keyword").value;
var str=document.getElementById("area").innerHTML;
var n=str.search(keyword);
alert('Location is :'+n);
}
</script>
<body>
<div id="searchdiv">
<input type="text" id="keyword" name="text" size="70" />
<input type="button" value="search" id="btn" name="button" onclick="search()"/>
<br>
<div style="width:444px;" id="area" name="textarea">rajendra kumar rahar from jhunjhunu</div>
</div>
</body>
<html>
i have tried so many times but couldnot get an idea to make highlight a specific text in div by javascript...???? If anybody have please tell me