I am planning to create a search engine for local html files in local server to search for html files by name and choose a folder from the list.
the main idea is to find .html files based on user input and he/she also must choose a folder from the list here is a code that has dropdown list, search box and submit button it now works fine on main folder but I need it to search in listed folders only
function redirect(){
var url=document.getElementById('test').value
window.location = url+".html"
}
function handleKeyUp(event) {
if (event.keyCode === 13) { //13 is enter keycode
redirect();
}
}
<select id="selectid">
<option j-link="" value="" selected="">please choose folder</option>
<option j-link="./1/" value="">folder1</option>
<option j-link="./2/" value="">folder2</option>
<option j-link="./3/" value="">folder3</option>
</select>
<input id="test" type="text" autofocus onkeyup="handleKeyUp(event)">
<button type="button" onclick="redirect()">Submit</button>