I have code for an auto-completing program, but I want to make it into a website search bar. What I need to know, is how to get access to the value of myCountry
.
Here's the part with myCountry
:
<form autocomplete="off" action="/action_page.php">
<div class="autocomplete" style="width:300px;">
<input id="myInput" type="text" name="myCountry" placeholder="Country">
</div>
Once I know how to do that, I think that I can just put an if else
statement into a JavaScript code.
What I thought I should do is use the getElementById()
function, but I'm new to html and JavaScript so I have no idea on what to do.
Here's a link to the full code=> link