I am trying to render a new webpage per value of the input type number but I have not gotten it.
HTML
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<input type="number" id="year" placeholder="2018" step="1" min="2014" max="2018" />
<input type="submit" id="start" value="Start" />
<script src="scripts.js"></script>
</body>
JAVASCRIPT/JQUERY
$("#start").click(function(){
if($("#year").val()===2018) {
window.open("https://www.freecodecamp.org/", "_blank");
}if($("#year").val()===2017) {
window.open("url-2", "_blank");
}
});
I used a valid url but to no avail. The page did not render. Please how do I make it work. Thanks.