not working for me not working for me


I am trying to render a new webpage per value of the input type number but I have not gotten it.


<script src=""></script>
<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>


      if($("#year").val()===2018) {"", "_blank");
      }if($("#year").val()===2017) {"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.


Remember, that $(“year”).val() will return a string value and you are using === to compare to a number, so they will never be equal.

Also, keep in mind that a placeholder value is not the same as a user entering/selecting an actual value for the input field. If you want to make the default value 2018, then use the value attribute like value=“2018”.


Your corrections worked like a charm. It is working now. Thank a lot.