<SCRIPT>
function fnFind(){
var sWhere = oSel.options[oSel.selectedIndex].text;
alert(oPara.getAdjacentText(sWhere));
}
</SCRIPT>
This is the text before (beforeBegin).
<P ID=oPara>
This is the text after (afterBegin).
<B>A few extra words.</B>
This is the text before (beforeEnd).
</P>
This is the text after (afterEnd).
<SELECT ID=oSel>
<OPTION SELECTED>beforeBegin
<OPTION>afterBegin
<OPTION>beforeEnd
<OPTION>afterEnd
</SELECT>
<INPUT TYPE="button" VALUE="Find text" >