I googled, and looked at stackoverflow and tried out the examples and i'm still having difficulties.
GOAL: Create a form box where a user can enter a city name so i can capture it in a variable and use it to look up the city lattitue and longitute from goodle geocode api.
Here is the HTML:
<div>
<form id="nameForm">
<input id="cityForm" type="text" >
<button id="subButton" type="button">Submit</button>
</form>
</div>
and here is my code i tried:
var theTerm = document.getElementById('cityForm').value;
console.log(theTerm);
console output gives me nothing.
I stripped the code down and removed the weather api stuff from it but basically i'm concerned about how i can capture a city name that was entered and 'submit' by a user. Here is the jsfiddle: https://jsfiddle.net/zt28sbo3/1/