Solution 1 :

You need to quote strings:
What you have will try to retrieve variable month, which should be your select DOM element.

Problem :

I am trying to pass data from form into JavaScript variables but I am having an issue, Errors are listed below.

    <select id="month" name="month"> 
      <option value="11">11</option>

<button onclick="calculate()"></button>

  function calculate() {
    var countMonth = document.getElementById(month).value;

Error: Uncaught TypeError: Cannot read property ‘value’ of null
at calculate (DateTracker.html:81) at HTMLButtonElement.onclick


Comment posted by

JScript would refer to Microsoft’s

Comment posted by EKrol

Sorry SO didn’t let me reply prevously, thank you for pointing out the error!