I have div, which has one input box and it generates some values in <ol><li> through ajax, now I wanted to select one of the values from <li> and set it in that input box using simple javascript.
Below is my actual script now -

<script type="text/javascript" language="JavaScript"> window.onload = function addSearchText() { document.getElementById("searchterms").value = 'Enter Search Term or Part #'; } function removeSearchText() { document.getElementById("searchterms").value =""; } </script>
and
In Body tag <form > <input type="text" name="searchTerms" id="searchterms" class="inptBx" onfocus="removeSearchText();"/> <html:image pageKey="img.common.catalogsearch_button" styleClass="btnGo" /> <div id="SuggestionListDiv"></div> </form>
Example : I have a div "SuggestionListDiv" which has a inputbox, if I search something in it I get result in <ol><li></li></ol> tags(dropdown) through ajax, Now if I click on any value from dropdown, I want this value to be set in my inputbox.

I have no control on generated <ol><li> tags, so through simple JS I have manage it.Please suggest a javascript solution for this.

Thanks in advance