HTML:
<div class="form-group">
<input class="input-sol form-control" id="focusedInput appendedInput sol" placeholder="Enter number" type="text" required>
<button class="btn btn-warning btn-large" id="submit" type="button" onClick="getUserChoice()">Get Images</button>
</div>
JavaScript:
function getUserChoice() {
var user_sol = document.getElementById("sol").value;
...
When I enter a value and click the button, my function is triggered but in console I get the following error:
Uncaught TypeError: Cannot read property 'value' of null
at getUserChoice (index.js:44)
at HTMLButtonElement.onclick (index.html:53)
The other values selected from a drop-down list are fine but not for this input.