http://jsfiddle.net/sLwuN/
Javascript
$("#prev").click(function(){
foundElement($(getSelection().focusNode.parentNode).prevAll('.find').first());
});
$("#next").click(function(){
foundElement($(getSelection().focusNode.parentNode).nextAll('.find').first());
});
function foundElement ($element) {
if ($element) {
$element.css('color', 'red');
setTimeout(function () {
$element.css('color', 'inherit');
}, 500);
}
}
HTML
<span class="find">A</span>
<i>BBBBB</i>
<span class="find">B</span>
<span class="find">CC</span>
<i>CCCCCC</i>
<span class="find">D</span>
<button id="prev">prev</button>
<button id="next">next</button>