I'm trying to figure out how to include an object at the end of my URL, but for some reason $year isn't getting added to the GET request.
<input type = "text" id="year">
<input type = "submit" id="btn">
<script >
document.getElementById("btn").addEventListener("click", function() {
var $year = document.getElementById("year");
request = new XMLHttpRequest();
request.open("GET", "https://mudfoot.doc.stu.mmu.ac.uk/node/api/halloffame?year="+$year, true);
request.send(null);
}
return val;
}